Make WordPress Core

Ticket #33789: 33789-wp-json-blacklist.patch

File 33789-wp-json-blacklist.patch, 1.7 KB (added by austinginder, 10 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 5876037..1965e99 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', 'wp-admin', 'wp-content', 'wp-includes' ) );
     50                $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed', 'wp-admin', 'wp-content', 'wp-includes', 'wp-json' ) );
    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 464d83e..da118ef 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', 'wp-admin', 'wp-content', 'wp-includes' ) )
     625                        apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed', 'wp-admin', 'wp-content', 'wp-includes', 'wp-json' ) )
    626626                );
    627627        }
    628628