From 32517ccbe49104b3d152003b183b93591c915980 Mon Sep 17 00:00:00 2001 From: yuriinalivaiko Date: Mon, 9 Jan 2023 21:37:25 +0200 Subject: [PATCH] - fixed PHP Warning if password is empty --- includes/core/um-actions-form.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/includes/core/um-actions-form.php b/includes/core/um-actions-form.php index 16adb5d5..11a14a08 100644 --- a/includes/core/um-actions-form.php +++ b/includes/core/um-actions-form.php @@ -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;