- fixed PHP Warning if password is empty

This commit is contained in:
yuriinalivaiko
2023-01-09 21:37:25 +02:00
parent b312b31d1e
commit 32517ccbe4
+3 -3
View File
@@ -620,7 +620,7 @@ function um_submit_form_errors_hook_( $args ) {
}
}
if ( isset( $array['force_good_pass'] ) && $array['force_good_pass'] == 1 ) {
if ( isset( $array['force_good_pass'] ) && $array['force_good_pass'] && ! empty( $args['user_password'] ) ) {
if ( isset( $args['user_login'] ) && strpos( strtolower( $args['user_login'] ), strtolower( $args['user_password'] ) ) > -1 ) {
UM()->form()->add_error( 'user_password', __( 'Your password cannot contain the part of your username', 'ultimate-member' ));
}
@@ -878,7 +878,7 @@ function um_submit_form_errors_hook_( $args ) {
}
}
break;
case 'alphabetic':
if ( $args[ $key ] != '' ) {
@@ -886,7 +886,7 @@ function um_submit_form_errors_hook_( $args ) {
if ( ! preg_match( '/^\p{L}+$/u', str_replace( ' ', '', $args[ $key ] ) ) ) {
UM()->form()->add_error( $key, __( 'You must provide alphabetic letters', 'ultimate-member' ) );
}
}
break;