Make WordPress Core

Opened 20 months ago

Last modified 8 weeks ago

#44690 new enhancement

Username should not accept space

Reported by: subrataemfluence Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Users Keywords: 2nd-opinion
Focuses: Cc:


The username field accepts space, not leading or trailing ones though. Space is usually not in the list of accepted characters.

I am not sure if it is there in purpose. Ideally it should not accept this character.

Username also accepts @, which is not an issue. But the problem starts when the username looks like an email address! When sending verification requests for Export and Erase private data the issue can be noticed.

However, if username has to accept @, WordPress should first check whether it is validating email address pattern. If it does, I think that should be reported rather than allowing it to get saved.

I explained the above issue in #44683.

Change History (3)

#1 @knutsp
20 months ago

I don't know is space is a problem, but email-looking usernames are. You can log in with either username or email, fine, but what if you are trying to log in using a email-like username? Two user may have the same string as username in one profile, and as email in the other.

@ is not the problem, but if a username validates as email, it should be rejected.

A completely different approach would be to deprecate usernames in favour of email, but that would be a drastic change.

#2 @pento
15 months ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.