From eee4049c9221644c6aa2786f72853df6cd58c5b3 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Sat, 4 Jul 2015 05:53:24 +0000 Subject: [PATCH] Usernames in multisite should be restricted to 60 characters or fewer. Only 60 characters can be stored in the database for a username, which could cause lookup issues when attempting to use similar usernames of extreme length. Props @DJPaul. See #17904, Fixes #26784. Built from https://develop.svn.wordpress.org/trunk@33083 git-svn-id: http://core.svn.wordpress.org/trunk@33054 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 8493b40b36..487d8401e5 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -494,6 +494,10 @@ function wpmu_validate_user_signup($user_name, $user_email) { if ( strlen( $user_name ) < 4 ) $errors->add('user_name', __( 'Username must be at least 4 characters.' ) ); + if ( strlen( $user_name ) > 60 ) { + $errors->add( 'user_name', __( 'Username may not be longer than 60 characters.' ) ); + } + if ( strpos( $user_name, '_' ) !== false ) $errors->add( 'user_name', __( 'Sorry, usernames may not contain the character “_”!' ) ); diff --git a/wp-includes/version.php b/wp-includes/version.php index 1a12f95484..0982d70d1f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.3-beta1-33082'; +$wp_version = '4.3-beta1-33083'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.