Opened 3 months ago
Last modified 3 months ago
#23430 new enhancement
sanitize_user() disallows + in usernames causes problem for email as username
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Users | Version: | 3.5.1 |
| Severity: | minor | Keywords: | has-patch |
| Cc: | jbrown510@… |
Description
I want to use email addresses as usernames which seems to work fine, except sanitize_user() doesn't allow a + in the username and my email addresses have + in them.
Google/gmail allows one to use a + modifier on emails like so:
user+admin@…, user+editor@…, user+author@…, etc...
I often use this to get around WordPress's requirement for unique email addresses but it's also intended for and useful in filtering: user+blog1@…, user+blog2@…, etc...
Is there a reason we can't allow +'s in usernames or could it be moved to the strict case only?
See formatting.php:892
Attachments (1)
Change History (4)
mario-siteground — 3 months ago
- Keywords has-patch added
comment:3
SergeyBiryukov — 3 months ago
I want to use email addresses as usernames which seems to work fine
Related: #22367

Tested with +-based username and works for me (creation of posts/pages, editing content, view of author page, user edit page). Adding a quick patch, unless the core team has other preferences.