Use preg_match more efficiently. props solarissmoke, fixes #17287.
git-svn-id: https://develop.svn.wordpress.org/trunk@18524 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
0c5290d9e3
commit
666b55d3c0
|
@ -646,13 +646,10 @@ function wpmu_validate_blog_signup($blogname, $blog_title, $user = '') {
|
|||
if (! is_subdomain_install() )
|
||||
$illegal_names = array_merge($illegal_names, apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) ) );
|
||||
|
||||
|
||||
if ( empty( $blogname ) )
|
||||
$errors->add('blogname', __('Please enter a site name'));
|
||||
|
||||
$maybe = array();
|
||||
preg_match( '/[a-z0-9]+/', $blogname, $maybe );
|
||||
if ( $blogname != $maybe[0] )
|
||||
if ( preg_match( '/[^a-z0-9]+/', $blogname ) )
|
||||
$errors->add('blogname', __('Only lowercase letters and numbers allowed'));
|
||||
|
||||
if ( in_array( $blogname, $illegal_names ) == true )
|
||||
|
|
Loading…
Reference in New Issue