From 213b41991331e805e8c38a85101361d8eaadd261 Mon Sep 17 00:00:00 2001 From: Mykyta Synelnikov Date: Tue, 24 Jun 2025 17:19:48 +0300 Subject: [PATCH] Fix user ID comparison with absint to ensure type safety Updated the user ID comparison logic in the Ultimate Member plugin to use `absint` for both values. This prevents type mismatches and ensures robust validation during form submission. --- 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 f89e9480..74c592af 100644 --- a/includes/core/um-actions-form.php +++ b/includes/core/um-actions-form.php @@ -956,7 +956,7 @@ function um_submit_form_errors_hook_( $submitted_data, $form_data ) { $the_similar_users = get_users( $args ); foreach ( $the_similar_users as $user ) { - if ( empty( $submitted_data['user_id'] ) || $user->ID !== $submitted_data['user_id'] ) { + if ( empty( $submitted_data['user_id'] ) || absint( $user->ID ) !== absint( $submitted_data['user_id'] ) ) { UM()->form()->add_error( $key, __( 'The email you entered is incorrect', 'ultimate-member' ) ); break; }