Simplify matching code. see #19670.

git-svn-id: https://develop.svn.wordpress.org/trunk@19852 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-02-07 17:44:29 +00:00
parent dc41877dc9
commit 7391c909df
1 changed files with 1 additions and 3 deletions

View File

@ -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;
}