Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 5 years ago

#22311 closed defect (bug) (invalid)

Cannot login when my loginname contains an "|" character

Reported by: radek2212's profile 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 (8)

#1 @Ipstenu
12 years ago

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

#2 @SergeyBiryukov
12 years ago

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

#3 @radek2212
12 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 ?

#4 @Ipstenu
12 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
12 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.

#6 @iseulde
11 years ago

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

#7 @SergeyBiryukov
11 years ago

  • Milestone Awaiting Review deleted

This ticket was mentioned in Slack in #core-editor by zieladam. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.