From ce6153d52abb4195683ba4ab823d3348f2fef998 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Fri, 7 Apr 2017 13:15:42 +0000 Subject: [PATCH] Multisite: Partially revert [40295]. [40295] removed the restriction of a minimum amount of characters for new site names, which could cause unexpected behavior. That changeset is reverted here with the exception of the removal of the `is_super_admin()` check, which can safely be omitted. A new filter for the minimum site name length will be introduced later to be able to modify that behavior. See #39676, #37616. Built from https://develop.svn.wordpress.org/trunk@40391 git-svn-id: http://core.svn.wordpress.org/trunk@40298 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-functions.php | 4 ++++ wp-includes/version.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index a562cdf241..9df86cfbde 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -577,6 +577,10 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) { if ( in_array( $blogname, $illegal_names ) ) $errors->add('blogname', __( 'That name is not allowed.' ) ); + if ( strlen( $blogname ) < 4 ) { + $errors->add('blogname', __( 'Site name must be at least 4 characters.' ) ); + } + // do not allow users to create a blog that conflicts with a page on the main blog. if ( !is_subdomain_install() && $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM " . $wpdb->get_blog_prefix( $current_network->site_id ) . "posts WHERE post_type = 'page' AND post_name = %s", $blogname ) ) ) $errors->add( 'blogname', __( 'Sorry, you may not use that site name.' ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index f75962b04a..20fd2cbf93 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40390'; +$wp_version = '4.8-alpha-40391'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.