Make WordPress Core

Ticket #54987: 54987.3.diff

File 54987.3.diff, 1.0 KB (added by csesumonpro, 3 years ago)

Patch added

  • src/wp-includes/user.php

     
    19771977         */
    19781978        if ( ! empty( $userdata['user_nicename'] ) ) {
    19791979                $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                 }
    19831980        } else {
    19841981                $user_nicename = mb_substr( $user_login, 0, 50 );
    19851982        }
     
    19951992         */
    19961993        $user_nicename = apply_filters( 'pre_user_nicename', $user_nicename );
    19971994
     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
    19981999        $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 ) );
    19992000
    20002001        if ( $user_nicename_check ) {