[wp-trac] [WordPress Trac] #57635: Check if empty user_nicename in the function wp_insert_user
WordPress Trac
noreply at wordpress.org
Mon Feb 6 13:57:42 UTC 2023
#57635: Check if empty user_nicename in the function wp_insert_user
----------------------------------------+-----------------------------
Reporter: missveronicatv | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Users | Version: 6.1.1
Severity: normal | Resolution:
Keywords: needs-patch good-first-bug | Focuses:
----------------------------------------+-----------------------------
Changes (by SergeyBiryukov):
* keywords: changes-requested => needs-patch good-first-bug
* milestone: Awaiting Review => Future Release
Comment:
Hi there, welcome back to WordPress Trac! Thanks for the ticket.
Good catch, looks like we should apply the same logic for `user_nicename`
as we do for `user_login`:
{{{
// user_login must be between 0 and 60 characters.
if ( empty( $user_login ) ) {
return new WP_Error( 'empty_user_login', __( 'Cannot create a user
with an empty login name.' ) );
} elseif ( mb_strlen( $user_login ) > 60 ) {
return new WP_Error( 'user_login_too_long', __( 'Username may not
be longer than 60 characters.' ) );
}
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/57635#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list