WordPress.org

Make WordPress Core

Changeset 33952


Ignore:
Timestamp:
09/08/2015 07:31:52 PM (4 years ago)
Author:
wonderboymusic
Message:

Multisite: Don't allow sites to be created with the following reserved slugs: wp-admin, wp-content, wp-includes

Props austinginder.
Fixes #33615.

Location:
trunk/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/site-new.php

    r33920 r33952  
    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 ) ) );
  • trunk/src/wp-includes/ms-functions.php

    r33184 r33952  
    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    }
Note: See TracChangeset for help on using the changeset viewer.