WordPress.org

Make WordPress Core

Opened 2 years ago

Closed 14 months ago

Last modified 14 months 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:

Description

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

Sent|el

or

P|ng|n

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

Change History (7)

comment:1 @Ipstenu2 years ago

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

comment:2 @SergeyBiryukov2 years ago

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

comment:3 @radek22122 years ago

Hi,
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 ?

comment:4 @Ipstenu2 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)

comment:5 @SergeyBiryukov2 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():
http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/formatting.php#L881

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.

comment:6 @iseulde14 months ago

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

comment:7 @SergeyBiryukov14 months ago

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