From 691f2fdc4802040d17e76e6f1f5663cf6293e0a7 Mon Sep 17 00:00:00 2001 From: ashubawork Date: Wed, 8 May 2024 10:41:12 +0300 Subject: [PATCH] - fix checking for unique_email validation --- includes/core/um-actions-form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/core/um-actions-form.php b/includes/core/um-actions-form.php index 259ac140..d3f60a98 100644 --- a/includes/core/um-actions-form.php +++ b/includes/core/um-actions-form.php @@ -924,7 +924,7 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { UM()->form()->add_error( $key, __( 'You must provide your email', 'ultimate-member' ) ); } elseif ( 'register' === $mode && $email_exists ) { UM()->form()->add_error( $key, __( 'The email you entered is incorrect', 'ultimate-member' ) ); - } elseif ( 'profile' === $mode && $email_exists && $email_exists !== $submitted_data['user_id'] ) { + } elseif ( 'profile' === $mode && $email_exists && absint( $email_exists ) !== absint( $submitted_data['user_id'] ) ) { UM()->form()->add_error( $key, __( 'The email you entered is incorrect', 'ultimate-member' ) ); } elseif ( ! is_email( $submitted_data[ $key ] ) ) { UM()->form()->add_error( $key, __( 'The email you entered is incorrect', 'ultimate-member' ) );