Index: src/wp-includes/user.php
===================================================================
--- src/wp-includes/user.php	(revision 52649)
+++ src/wp-includes/user.php	(working copy)
@@ -1977,9 +1977,6 @@
 	 */
 	if ( ! empty( $userdata['user_nicename'] ) ) {
 		$user_nicename = sanitize_user( $userdata['user_nicename'], true );
-		if ( mb_strlen( $user_nicename ) > 50 ) {
-			return new WP_Error( 'user_nicename_too_long', __( 'Nicename may not be longer than 50 characters.' ) );
-		}
 	} else {
 		$user_nicename = mb_substr( $user_login, 0, 50 );
 	}
@@ -1986,6 +1983,13 @@
 
 	$user_nicename = sanitize_title( $user_nicename );
 
+	/*
+	 * Check user_nicename not more then 50 characters.
+	 */
+	if ( mb_strlen( $user_nicename ) > 50 ) {
+		$user_nicename = mb_substr( $user_nicename, 0, 50 );
+	}
+
 	/**
 	 * Filters a user's nicename before the user is created or updated.
 	 *
