WordPress.org

Make WordPress Core

Ticket #13304: 14902.patch

File 14902.patch, 1.4 KB (added by jorbin, 4 years ago)
  • wp-includes/ms-functions.php

     
    556556                add_site_option( 'illegal_names', $illegal_names ); 
    557557        } 
    558558 
     559        // On sub dir installs, Some names are so illegal, only a filter can spring them from jail 
     560        if (! is_subdomain_install() ) 
     561                $illegal_names = array_merge($illegal_names, apply_filters( 'subsirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) ) ); 
     562 
     563 
    559564        if ( empty( $blogname ) ) 
    560565                $errors->add('blogname', __('Please enter a site name')); 
    561566 
  • wp-admin/ms-edit.php

     
    147147                $domain = ''; 
    148148                if ( ! preg_match( '/(--)/', $blog['domain'] ) && preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) 
    149149                        $domain = strtolower( $blog['domain'] ); 
     150 
     151                // If not a subdomain install, make sure the domain isn't a reserved word 
     152                if (! is_subdomain_install() && in_array($domain, apply_filters( 'subsirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) ) ) 
     153                ) 
     154                        wp_die( __('blog, comments, page, files and feed are not vaild names and are reserved for use by WordPress' ) ); 
     155 
    150156                $email = sanitize_email( $blog['email'] ); 
    151157                $title = $blog['title']; 
    152158