From 4d83a7eec36c89d1d5cd5cb35ceb10d566e4b7e0 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Wed, 25 Jun 2025 16:24:14 +0300 Subject: [PATCH 1/2] Fix email validation logic in Ultimate Member forms Updated conditions to handle empty and invalid email input more accurately. Ensures required emails are not skipped and includes stricter checks for existing or incorrect emails. --- includes/core/um-actions-form.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/core/um-actions-form.php b/includes/core/um-actions-form.php index 74c592af..b79f25da 100644 --- a/includes/core/um-actions-form.php +++ b/includes/core/um-actions-form.php @@ -937,9 +937,9 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { break; } - if ( ! empty( $array['required'] ) && '' === $submitted_data[ $key ] ) { + if ( ! empty( $array['required'] ) && empty( $submitted_data[ $key ] ) ) { UM()->form()->add_error( $key, __( 'You must provide your email', 'ultimate-member' ) ); - } elseif ( ! is_email( $submitted_data[ $key ] ) || email_exists( $submitted_data[ $key ] ) ) { + } elseif ( ! empty( $submitted_data[ $key ] ) && ( ! is_email( $submitted_data[ $key ] ) || email_exists( $submitted_data[ $key ] ) ) ) { UM()->form()->add_error( $key, __( 'The email you entered is incorrect', 'ultimate-member' ) ); } elseif ( 'secondary_user_email' === $key && ! empty( $submitted_data[ $key ] ) && ! empty( $submitted_data['user_email'] ) && $submitted_data[ $key ] === $submitted_data['user_email'] ) { UM()->form()->add_error( $key, __( 'The secondary email cannot be the same as primary', 'ultimate-member' ) ); From 561b2b386ab12b9160baa21390fd2ccfe6c498de Mon Sep 17 00:00:00 2001 From: "WordPress .pot File Generator" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 13:24:35 +0000 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=84=20Generated=20POT=20File?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- languages/ultimate-member.pot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/languages/ultimate-member.pot b/languages/ultimate-member.pot index 3c5a00dd..7059a689 100644 --- a/languages/ultimate-member.pot +++ b/languages/ultimate-member.pot @@ -9,7 +9,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2025-06-25T13:01:29+00:00\n" +"POT-Creation-Date: 2025-06-25T13:24:33+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.12.0\n" "X-Domain: ultimate-member\n"