diff --git a/wp-includes/user-functions.php b/wp-includes/user-functions.php index af3d1e2db1..ec00edc9d0 100644 --- a/wp-includes/user-functions.php +++ b/wp-includes/user-functions.php @@ -1176,13 +1176,15 @@ function email_exists( $email ) { * Checks whether a username is valid. * * @since 2.0.1 + * @since 4.4.0 Empty sanitized usernames are now considered invalid * * @param string $username Username. * @return bool Whether username given is valid */ function validate_username( $username ) { $sanitized = sanitize_user( $username, true ); - $valid = ( $sanitized == $username ); + $valid = ( $sanitized == $username && ! empty( $sanitized ) ); + /** * Filter whether the provided username is valid or not. * diff --git a/wp-includes/version.php b/wp-includes/version.php index a5487bc3d8..859a132132 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34855'; +$wp_version = '4.4-alpha-34856'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.