WordPress.org

Make WordPress Core

Ticket #33615: 33615-directory-fix-v2.patch

File 33615-directory-fix-v2.patch, 1.6 KB (added by austinginder, 4 years ago)
  • src/wp-admin/network/site-new.php

    diff --git src/wp-admin/network/site-new.php src/wp-admin/network/site-new.php
    index 4d8d444..5876037 100644
    if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) { 
    4747        // If not a subdomain install, make sure the domain isn't a reserved word
    4848        if ( ! is_subdomain_install() ) {
    4949                /** This filter is documented in wp-includes/ms-functions.php */
    50                 $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) );
     50                $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed', 'wp-admin', 'wp-content', 'wp-includes' ) );
    5151                if ( in_array( $domain, $subdirectory_reserved_names ) )
    5252                        wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: <code>%s</code>' ), implode( '</code>, <code>', $subdirectory_reserved_names ) ) );
    5353        }
  • src/wp-includes/ms-functions.php

    diff --git src/wp-includes/ms-functions.php src/wp-includes/ms-functions.php
    index edbb984..464d83e 100644
    function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) { 
    622622                         *
    623623                         * @param array $subdirectory_reserved_names Array of reserved names.
    624624                         */
    625                         apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed' ) )
     625                        apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed', 'wp-admin', 'wp-content', 'wp-includes' ) )
    626626                );
    627627        }
    628628