Make WordPress Core

Ticket #54987: 52650.patch

File 52650.patch, 903 bytes (added by mukesh27, 3 years ago)

Patch that include another solution

  • 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        }
     
    19861983
    19871984        $user_nicename = sanitize_title( $user_nicename );
    19881985
     1986        /*
     1987         * Check user_nicename not more then 50 characters.
     1988         */
     1989        if ( mb_strlen( $user_nicename ) > 50 ) {
     1990                $user_nicename = mb_substr( $user_nicename, 0, 50 );
     1991        }
     1992
    19891993        /**
    19901994         * Filters a user's nicename before the user is created or updated.
    19911995         *