Skip to content

Commit

Permalink
Coding Standards: Use strict comparison in `wpmu_validate_user_signup…
Browse files Browse the repository at this point in the history
…()`.

Follow-up to [14298], [19852].

Props debarghyabanerjee.
See #62283.

git-svn-id: https://develop.svn.wordpress.org/trunk@59557 602fd350-edb4-49c9-b593-d223f7449a82
  • Loading branch information
SergeyBiryukov committed Dec 23, 2024
1 parent 07be244 commit a9e2f1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/wp-includes/ms-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ function wpmu_validate_user_signup( $user_name, $user_email ) {
$orig_username = $user_name;
$user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) );

if ( $user_name != $orig_username || preg_match( '/[^a-z0-9]/', $user_name ) ) {
if ( $user_name !== $orig_username || preg_match( '/[^a-z0-9]/', $user_name ) ) {
$errors->add( 'user_name', __( 'Usernames can only contain lowercase letters (a-z) and numbers.' ) );
$user_name = $orig_username;
}
Expand Down

0 comments on commit a9e2f1c

Please sign in to comment.