Merge pull request #1119 from ultimatemember/fix/php_warning_if_empty_password

Fix php warning if empty password
This commit is contained in:
Nikita Sinelnikov
2023-02-06 12:39:44 +02:00
committed by GitHub
+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;