WordPress.org

Make WordPress Core

Ticket #17287: 17287.2.diff

File 17287.2.diff, 796 bytes (added by solarissmoke, 4 years ago)

Even simpler still

  • wp-includes/ms-functions.php

     
    644644        if (! is_subdomain_install() ) 
    645645                $illegal_names = array_merge($illegal_names, apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) ) ); 
    646646 
    647  
    648647        if ( empty( $blogname ) ) 
    649648                $errors->add('blogname', __('Please enter a site name')); 
    650649 
    651         $maybe = array(); 
    652         preg_match( '/[a-z0-9]+/', $blogname, $maybe ); 
    653         if ( $blogname != $maybe[0] ) 
     650        if ( preg_match( '/[^a-z0-9]+/', $blogname ) ) 
    654651                $errors->add('blogname', __('Only lowercase letters and numbers allowed')); 
    655652 
    656653        if ( in_array( $blogname, $illegal_names ) == true )