Opened 3 years ago
Last modified 3 years ago
#53109 reviewing defect (bug)
wp_insert_user should return a WP_Error when passing a too long first_name parameter
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | Awaiting Review | Priority: | normal |
Severity: | normal | Version: | |
Component: | Users | Keywords: | needs-patch |
Focuses: | Cc: |
Description
When I call the wp_insert_user function to which I pass too long first_name, I do not get an error, but I get a 0-integer. Although the documentation says, either wp_error or integer-ok.
P.S. I create user with this function ..
Change History (4)
#1
@
3 years ago
- Focuses coding-standards removed
- Owner set to audrasjb
- Status changed from new to reviewing
- Summary changed from wp_insert_user return 0 to wp_insert_user should return a WP_Error when passing a too long first_name parameter
- Version 5.7 deleted
#2
@
3 years ago
Hi there, welcome to WordPress Trac! Thanks for the report.
Looks like this was previously mentioned in comment:3:ticket:14290 but never addressed.
A similar issue was resolved in WordPress 4.4 for user_login
and user_nicename
fields: [34218] / #33793, #33820. Looks like we need the same for first_name
and last_name
.
#3
follow-up:
↓ 4
@
3 years ago
I found something interesting: it looks like the limit is at 250 character. Also, I'm not sure it's really related to the first_name
or last_name
metadata.
I believe it's more related to the fact that display_name
is based on first_name
/last_name
metadata.
For the moment, I wasn't able to find where this 250 char limit is set. @SergeyBiryukov do you have any clue?
#4
in reply to:
↑ 3
@
3 years ago
Replying to audrasjb:
I believe it's more related to the fact that
display_name
is based onfirst_name
/last_name
metadata.
Ah, good point.
For the moment, I wasn't able to find where this 250 char limit is set. @SergeyBiryukov do you have any clue?
I think it's in the database schema: display_name varchar(250) NOT NULL default ''
.
Hi, welcome to WordPress Trac @superpuperlesha and thank you for the ticket,
Looking at a glance, wp_insert_user should return WP_Error or create the user without this parameter. Self-assigning the ticket for further investigation.