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.
This commit is contained in:
Mykyta Synelnikov
2025-06-24 17:19:48 +03:00
parent 524670ad53
commit 213b419913
+1 -1
View File
@@ -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;
}