From 5dd7bec8483d2f0e59c9330bc2c8ea3ee41b92d8 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 22 Sep 2015 04:20:41 +0000 Subject: [PATCH] Multisite: as a precaution, make `wp-json` a reserved subdirectory name. Props austinginder. Fixes #33789. git-svn-id: https://develop.svn.wordpress.org/trunk@34375 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/network/site-new.php | 2 +- src/wp-includes/ms-functions.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-admin/network/site-new.php b/src/wp-admin/network/site-new.php index 665f2abc40..ea87438f95 100644 --- a/src/wp-admin/network/site-new.php +++ b/src/wp-admin/network/site-new.php @@ -47,7 +47,7 @@ if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) { // If not a subdomain install, make sure the domain isn't a reserved word if ( ! is_subdomain_install() ) { /** This filter is documented in wp-includes/ms-functions.php */ - $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed', 'wp-admin', 'wp-content', 'wp-includes' ) ); + $subdirectory_reserved_names = apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed', 'wp-admin', 'wp-content', 'wp-includes', 'wp-json' ) ); if ( in_array( $domain, $subdirectory_reserved_names ) ) wp_die( sprintf( __('The following words are reserved for use by WordPress functions and cannot be used as blog names: %s' ), implode( ', ', $subdirectory_reserved_names ) ) ); } diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php index a6c2d02d2b..aedc36c828 100644 --- a/src/wp-includes/ms-functions.php +++ b/src/wp-includes/ms-functions.php @@ -623,7 +623,7 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) { * * @param array $subdirectory_reserved_names Array of reserved names. */ - apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed', 'wp-admin', 'wp-content', 'wp-includes' ) ) + apply_filters( 'subdirectory_reserved_names', array( 'page', 'comments', 'blog', 'files', 'feed', 'wp-admin', 'wp-content', 'wp-includes', 'wp-json' ) ) ); }