Make WordPress Core

Opened 3 years ago

Closed 2 years ago

Last modified 2 years ago

#22311 closed defect (bug) (invalid)

Cannot login when my loginname contains an "|" character

Reported by: radek2212 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Users Keywords:
Focuses: Cc:


Cannot login when my loginname contains an "|" character, for example:




Can you fix his ? Other systems like phpBB3 have no problems with such usernames !

Change History (7)

#1 @Ipstenu
3 years ago

You can't register a username with a | character at all. How did you even end up with that?

#2 @SergeyBiryukov
3 years ago

  • Component changed from Charset to Users
  • Keywords reporter-feedback added

#3 @radek2212
3 years ago

I remember that i was able to create such account at one of WP blog. Maybe it was old version or so. Anyway, if this character is not allowed, it's even worse for WP: how people can create a nicknames with "clan" tags ? Like: sk|Okimi or similar ?

#4 @Ipstenu
3 years ago

You could use Display Names for that. But due to how names are sanitized, I'm not surprised that login names have to be only a-z0-9 (we also use them as the default subdomain in Multisite)

#5 @SergeyBiryukov
3 years ago

  • Keywords close added; reporter-feedback removed

"|" isn't a valid username character in WordPress. If you try to register as P|ng|n in 3.4.2, you'll get an error message:

ERROR: This username is invalid because it uses illegal characters. Please enter a valid username.

Current valid characters are listed in sanitize_user():

You can, however, set your display name to whatever you like, including P|ng|n or sk|Okimi.

If you still need your users to be able to register with "|" character in usernames for some reason, sanitize_user filter can be used for that. See an example plugin in #18666.

#6 @iseulde
2 years ago

  • Keywords close removed
  • Resolution set to invalid
  • Status changed from new to closed

#7 @SergeyBiryukov
2 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.