[wp-trac] [WordPress Trac] #33820: Fail to create a user whose username is longer than 50

WordPress Trac noreply at wordpress.org
Fri Sep 11 02:16:06 UTC 2015


#33820: Fail to create a user whose username is longer than 50
--------------------------+-----------------------------
 Reporter:  hykw          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Users         |    Version:  4.3
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When you create a user, the length of username is 50 or more, it fails to
 create the user. And also the result message is as same as the correctly
 does.

 It could easily reproduce the issue like this in admin:
 {{{
 Users > Add New

   Username: 000000000000000000000000000000000000000000000000001
   E-mail: foo at example.com

 press [Add New User]
 }}}

 or with wp_insert_user():
 {{{
 $login = '000000000000000000000000000000000000000000000000001';

 $wp_insert_data = array(
   'user_login' => $login,
   'user_email' => 'foo at example.com',
   'user_pass' => NULL,
 );

 $user_id = wp_insert_user($wp_insert_data);

 # ----> The value of $user_id is 0
 # It should be WP_Error or userid(which is 1 or more), but not.
 }}}

 Some logic in Wordpress expects WP_Error in case of error, it also
 occurred Notice error in wp_new_user_notification(), due to
 $user->user_login is wrong.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/33820>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list