[wp-trac] [WordPress Trac] #54987: Check if 'user_nicename' is not too long after the 'pre_user_nicename' filter

WordPress Trac noreply at wordpress.org
Sat Jan 29 14:36:04 UTC 2022


#54987: Check if 'user_nicename' is not too long after the 'pre_user_nicename'
filter
----------------------------+----------------------------------------
 Reporter:  SergeyBiryukov  |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  6.0
Component:  Users           |    Version:
 Severity:  normal          |   Keywords:  needs-patch good-first-bug
  Focuses:                  |
----------------------------+----------------------------------------
 Background: #33793, #44107.

 In `wp_insert_user()`, there are a few checks to make sure the values are
 not too long to fit into the database:
 * `user_login` may not be longer than 60 characters.
 * `user_nicename` may not be longer than 50 characters.
 * `user_url` may not be longer than 100 characters.

 Some history: [34218], [34626], [52650].

 While the `user_login` and `user_url` checks run after the
 `pre_user_login` and `pre_user_url` filters, respectively, the
 `user_nicename` check for some reason runs ''before'' the
 `pre_user_nicename` filter.

 For consistency with the other filters, and to make sure the filtered
 value is still no longer than 50 characters, the `mb_strlen(
 $user_nicename ) > 50` check should run after the `pre_user_nicename`
 filter.

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


More information about the wp-trac mailing list