[wp-trac] [WordPress Trac] #33793: Adding a user with a username 52 characters or longer fails, but displays success message.

WordPress Trac noreply at wordpress.org
Wed Sep 9 16:31:13 UTC 2015


#33793: Adding a user with a username 52 characters or longer fails, but displays
success message.
----------------------------+-----------------------------
 Reporter:  tommarshall     |      Owner:
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Users           |    Version:  3.8.8
 Severity:  normal          |   Keywords:
  Focuses:  administration  |
----------------------------+-----------------------------
 Steps to reproduce:

 1. Login
 2. Users -> Add New (/wp-admin/user-new.php)
 3. Fill out the form with following data:
 '''Username:''' Any valid email with 52 characters or more, e.g.
 `abcdefghijklmnopqrstuvwxyzabcdefghijklmn [at] example.com` (without the
 email obfuscation).
 '''E-mail:''' ''Any''
 '''Password:''' ''Any''
 '''Repeat Password:''' ''Any''
 4. Submit form by 'Add New User' button.
 5. WordPress redirects to Users page (/wp-admin/users.php?id=0) with a
 'New user created.' success message, but the user is not visible in list,
 and is not present in `wp_users` table.

 If you repeat the steps specifying a username that is 51 characters or
 less, then the new user is created correctly, and the success message
 includes an 'Edit user' link.

 I've seen this broken behaviour in:
 * 4.3
 * 4.2.1
 * 3.9
 * 3.8.8

 In 3.8.7 adding a user with a username >51 characters (and >60 characters)
 creates a new user correctly. The username is truncated to the first 60
 characters when necessary. (`wp_users.user_login` is a `varchar(60)`).

 I suspect the reason 51 characters succeeds and 52 does not may be to do
 with the `wp_users.user_nicename` field, which is a `varchar(50)`. The add
 new user operation auto generates the `user_nicename` value, as a
 sanitised form of the `user_login`, stripping the `@` in the process. I
 have not confirmed this though.

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


More information about the wp-trac mailing list