Make WordPress Core

Ticket #33793: 33793.diff

File 33793.diff, 3.2 KB (added by dipesh.kakadiya, 10 years ago)

By default username set as user_nicename but in schema both have diffrent size.

  • src/wp-admin/includes/schema.php

     
    186186  ID bigint(20) unsigned NOT NULL auto_increment,
    187187  user_login varchar(60) NOT NULL default '',
    188188  user_pass varchar(64) NOT NULL default '',
    189   user_nicename varchar(50) NOT NULL default '',
     189  user_nicename varchar(60) NOT NULL default '',
    190190  user_email varchar(100) NOT NULL default '',
    191191  user_url varchar(100) NOT NULL default '',
    192192  user_registered datetime NOT NULL default '0000-00-00 00:00:00',
  • src/wp-admin/includes/user.php

     
    104104
    105105        $errors = new WP_Error();
    106106
    107         /* checking that username has been typed */
     107        /* checking that username has been typed and user_login is less than 50 characters*/
    108108        if ( $user->user_login == '' )
    109109                $errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username.' ) );
    110 
     110        elseif ( strlen( $user->user_login ) > 60 )
     111                $errors->add( 'user_login', __( '<strong>ERROR</strong>: Please enter a username less than 50 characters.' ) );
    111112        /* checking the password has been typed twice */
    112113        /**
    113114         * Fires before the password and confirm password fields are checked for congruity.
  • src/wp-admin/network/user-new.php

     
    8989        <table class="form-table">
    9090                <tr class="form-field form-required">
    9191                        <th scope="row"><label for="username"><?php _e( 'Username' ) ?></label></th>
    92                         <td><input type="text" class="regular-text" name="user[username]" id="username" autocapitalize="none" autocorrect="off" /></td>
     92                        <td><input type="text" class="regular-text" name="user[username]" id="username" autocapitalize="none" autocorrect="off" maxlength="60" /></td>
    9393                </tr>
    9494                <tr class="form-field form-required">
    9595                        <th scope="row"><label for="email"><?php _e( 'Email' ) ?></label></th>
  • src/wp-admin/user-new.php

     
    393393<table class="form-table">
    394394        <tr class="form-field form-required">
    395395                <th scope="row"><label for="user_login"><?php _e('Username'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>
    396                 <td><input name="user_login" type="text" id="user_login" value="<?php echo esc_attr( $new_user_login ); ?>" aria-required="true" autocapitalize="none" autocorrect="off" /></td>
     396                <td><input name="user_login" type="text" id="user_login" value="<?php echo esc_attr( $new_user_login ); ?>" aria-required="true" autocapitalize="none" autocorrect="off" maxlength="60" /></td>
    397397        </tr>
    398398        <tr class="form-field form-required">
    399399                <th scope="row"><label for="email"><?php _e('Email'); ?> <span class="description"><?php _e('(required)'); ?></span></label></th>