Opened 13 years ago
Closed 11 years ago
#26784 closed defect (bug) (fixed)
User registration on multisite: don't allow usernames to be >60 characters long.
| Reported by: | DJPaul | Owned by: | jeremyfelt |
|---|---|---|---|
| Priority: | normal | Milestone: | 4.3 |
| Component: | Login and Registration | Version: | 3.0 |
| Severity: | normal | Keywords: | has-patch |
| Cc: | Focuses: | multisite |
Description
In wpmu_validate_user_signup() at the "has someone already signed up for this username?" check, it doesn't work as expected in situations where $wpdb->signups has truncated a new record's user_login value down to its maximum column size (which is 60 characters). The check will never match any records where the new username is >60 characters.
To recreate on multisite:
- Register a new user account with a 60-character long username via
wp-login.php?action=register. - Activate the account via link provided in email, and log in.
- Everything should work as expected. Log out.
- Register another new user account; use a different email address. Use the same username as previously, but add at least 1 extra character to the end of it.
- It will accept this username, though you'll be unable to activate the account. It will say that it's already been activated; look at the record in the
wp_signupstable and see thatuser_loginhas been truncated to the first 60 characters of the string you provided.
The attached patch adds a new validation check to wpmu_validate_user_signup() which rejects the username if it's >60 characters.
Attachments (1)
Change History (11)
#8
follow-up:
↓ 9
@
11 years ago
- Owner set to
- Status new → assigned
Can this be consolidated with #17904?
#9
in reply to: ↑ 8
@
11 years ago
- Keywords needs-testing removed
Replying to wonderboymusic:
Can this be consolidated with #17904?
I think we can get this one in now as the change is very small and tests are in place. After re-reading #17904, I think it's a lot closer than I remembered. We can continue work there for the next cycle.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
Given
user_login varchar(60) NOT NULL default '',, seems good to me.