From 7391c909dfcda4106ed074adb5db127c12fa8c4b Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 7 Feb 2012 17:44:29 +0000 Subject: [PATCH] Simplify matching code. see #19670. git-svn-id: https://develop.svn.wordpress.org/trunk@19852 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/ms-functions.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index ee944784c7..5721fefaf5 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -436,10 +436,8 @@ function wpmu_validate_user_signup($user_name, $user_email) { $orig_username = $user_name; $user_name = preg_replace( '/\s+/', '', sanitize_user( $user_name, true ) ); - $maybe = array(); - preg_match( '/[a-z0-9]+/', $user_name, $maybe ); - if ( $user_name != $orig_username || ( !empty( $maybe ) && $user_name != $maybe[0] ) ) { + if ( $user_name != $orig_username || preg_match( '/[^a-z0-9]/', $user_name ) ) { $errors->add( 'user_name', __( 'Only lowercase letters (a-z) and numbers are allowed.' ) ); $user_name = $orig_username; }