From 51bc8b5a7b534db313f1c2e3c4425d490f2b7972 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Mon, 29 Apr 2013 14:49:57 +0000 Subject: [PATCH] Better logic for preg_match() calls in ms-functions.php. fixes #24222. git-svn-id: https://develop.svn.wordpress.org/trunk@24130 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/ms-functions.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index 3b456fb2c0..516f61b919 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -460,9 +460,7 @@ function wpmu_validate_user_signup($user_name, $user_email) { $errors->add( 'user_name', __( 'Sorry, usernames may not contain the character “_”!' ) ); // all numeric? - $match = array(); - preg_match( '/[0-9]*/', $user_name, $match ); - if ( $match[0] == $user_name ) + if ( preg_match( '/^[0-9]*$/', $user_name ) ) $errors->add('user_name', __('Sorry, usernames must have letters too!')); if ( !is_email( $user_email ) ) @@ -572,9 +570,7 @@ function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') { $errors->add( 'blogname', __( 'Sorry, you may not use that site name.' ) ); // all numeric? - $match = array(); - preg_match( '/[0-9]*/', $blogname, $match ); - if ( $match[0] == $blogname ) + if ( preg_match( '/^[0-9]*$/', $blogname ) ) $errors->add('blogname', __('Sorry, site names must have letters too!')); $blogname = apply_filters( 'newblogname', $blogname );