Ticket #54987: 54987.3.diff
File 54987.3.diff, 1.0 KB (added by , 3 years ago) |
---|
-
src/wp-includes/user.php
1977 1977 */ 1978 1978 if ( ! empty( $userdata['user_nicename'] ) ) { 1979 1979 $user_nicename = sanitize_user( $userdata['user_nicename'], true ); 1980 if ( mb_strlen( $user_nicename ) > 50 ) {1981 return new WP_Error( 'user_nicename_too_long', __( 'Nicename may not be longer than 50 characters.' ) );1982 }1983 1980 } else { 1984 1981 $user_nicename = mb_substr( $user_login, 0, 50 ); 1985 1982 } … … 1995 1992 */ 1996 1993 $user_nicename = apply_filters( 'pre_user_nicename', $user_nicename ); 1997 1994 1995 if ( mb_strlen( $user_nicename ) > 50 ) { 1996 return new WP_Error( 'user_nicename_too_long', __( 'Nicename may not be longer than 50 characters.' ) ); 1997 } 1998 1998 1999 $user_nicename_check = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1", $user_nicename, $user_login ) ); 1999 2000 2000 2001 if ( $user_nicename_check ) {