[wp-trac] [WordPress Trac] #17904: Multisite has more restrictions on user login character set

WordPress Trac noreply at wordpress.org
Fri May 20 20:23:16 UTC 2016


#17904: Multisite has more restrictions on user login character set
--------------------------------------+-------------------------
 Reporter:  duck_                     |       Owner:  jeremyfelt
     Type:  defect (bug)              |      Status:  assigned
 Priority:  normal                    |   Milestone:  4.6
Component:  Login and Registration    |     Version:  3.0
 Severity:  normal                    |  Resolution:
 Keywords:  has-patch has-unit-tests  |     Focuses:  multisite
--------------------------------------+-------------------------

Comment (by ericlewis):

 Replying to [comment:52 jeremyfelt]:
 > I think deprecating `validate_username()` is the right answer, as core
 will no longer use it, though I'm not sure the internals should change
 immediately. It performs a very direct task at the moment.

 This sounds good. Let's add a deprecated call to point developers to the
 `wp_validate_user_login()` in the next patch, and move it into
 `deprecated.php`.

 > Would anything break if we adjusted the order of the `is_multisite()`
 checks a bit for readability? Illegal names could go after illegal user
 logins. Username exists could go after the pending signups. It may be
 easier then to spot the single site/multisite differences.

 Good question. Error ordering in the resulting `WP_Error` would change.

 On a related note, the current patch changes error codes that would be
 returned by `register_new_user()`, `edit_user()` or
 `wpmu_validate_user_signup()`. Previously they perform the same checks and
 return different error codes. E.g. the `validate_username()` check in
 `edit_user()` would return the error code `user_login`, and the
 `validate_username()` check in `register_new_user()` would return the
 error code `invalid_username `. The current patch changes this error code
 to `user_name`. Is changing error code responses okay, or should we
 consider some backward compat shim for these cases?

--
Ticket URL: <https://core.trac.wordpress.org/ticket/17904#comment:53>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list