Make WordPress Core

Opened 19 years ago

Last modified 7 months ago

#5918 new feature request

Allow non-ASCII usernames

Reported by: marshosh Owned by:
Priority: normal Milestone: Future Release
Component: Charset Version: 2.3.3
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses:

Description (last modified by dmsnell)

WordPress currently transforms usernames and potential usernames into a restricted set of ASCII characters. It attempts to remove HTML, diacritics, and transform other characters to ASCII equivalents, stripping away anything that remains.

This prevents storing usernames that correspond to someone’s name or chosen identify, if that name falls outside the restricted range. For example, the username 北斎 is unusable because sanitize_user( '北斎', true ) returns the empty string.

WordPress should relax its restrictions on usernames to be more inclusive and permit locale-specific sites and users to express themselves as they are, not having to make concessions for latin-based technology.

Complications

  • Not all restrictions should be removed, but it would be important to double-down on the original intent of those filters; notably, to limit confusable characters such as non-printable and non-visible characters. Unicode defines considerably more complicated text rules, so an update to the system should improve the Unicode compliance surrounding these issues.
  • Given the higher probability of multiple representations for non-ASCII usernames, it would be important to normalize all inputs using an appriate algorithm, such as NKFD.
  • Existing code and plugins are going to assume ASCII-only usernames and unlocking more complete naming should not introduce any more backwards compatibility breaks than are absolutely necessary.
  • Some installations will be running on non-UTF-8 database tables which cannot represent all possible Unicode-based usernames. For these installations, it must be clear that extended username support is unavailable.
  • Any changes to URL routing need to maintain redirects to the legacy ASCII-based structure to prevent breaking existing integrations which assume the fixed patterns; for example, /author/dmsnell should redirect to /autor/dmsnell on a German site…

Help

Unicode provides ample guidance here which can help WordPress to:

  • avoid known security issues
  • implement these behaviors in harmony with expectations from other software
  • how to best display these characters in interfaces

Warnings

  • #62948 Non-ASCII slugs need comprehensive transformation and inspection as well.

Attachments (6)

registration.php.patch​ (779 bytes ) - added by dwright 17 years ago.
dont enforce strict on registration names patch, against revision 12187
arabic_user_register.png​ (14.8 KB ) - added by dwright 17 years ago.
register user with arabic name
arabic_user_login.png​ (24.2 KB ) - added by dwright 17 years ago.
arabic user login
arabic_user_admin_area.png​ (2.3 KB ) - added by dwright 17 years ago.
admin area (simple)
arabic_user_admin_area_edit2.png​ (42.6 KB ) - added by dwright 17 years ago.
edit arabic user
5918-Allow-non-ASCII-usernames.diff​ (662 bytes ) - added by sachinrajcp123 15 months ago.

Download all attachments as: .zip

Change History (44)

#1 @Denis-de-Bernardy
18 years ago

  • Keywords needs-patch added; Arabic Non-English characters removed

related: #9591

#2 @Denis-de-Bernardy
17 years ago

  • Component General → Users
  • Owner anonymous removed

#3 @Denis-de-Bernardy
17 years ago

possibly related: #5472

#4 @dwright
17 years ago

  • Cc david_v_wright@… added

Here is a patch that will enable a user to register with an arabic name.

(however, it also probably introduces security issues)

@dwright
17 years ago

dont enforce strict on registration names patch, against revision 12187

@dwright
17 years ago

register user with arabic name

@dwright
17 years ago

arabic user login

@dwright
17 years ago

admin area (simple)

@dwright
17 years ago

edit arabic user

#5 @dwright
17 years ago

  • Keywords has-patch added; needs-patch removed

#6 @ryan
17 years ago

  • Milestone 2.9 → 3.0

Something to consider for 3.0 after considering all security ramifications.

#7 @dd32
17 years ago

  • Keywords early added
  • Milestone 3.0 → 3.1

Moving to 3.1, As ryan said, We need to consider any of the security ramifications of this change. We're nearing beta right now, it doesn't seem appropriate to change this late in the game.

#8 @nacin
16 years ago

  • Keywords early removed
  • Milestone Awaiting Triage → Future Release

#9 @mamouneyya
15 years ago

  • Cc mamouneyya added
  • Summary Registr with Arabic (Non-English) characters ? → Allow non-ASCII usernames
  • Version 2.3.3 → 3.1

Please consider implementing this in 3.2. Registration always confuses my users because they cannot use non-ASCII characters.

#10 @dd32
15 years ago

  • Version 3.1 → 2.3.3

Please leave the version field set to when it was originally reported.

#11 @mamouneyya
15 years ago

Sorry, I was just trying to say that the same issue still exists in the latest version.

#12 @cupid4
15 years ago

  • Version 2.3.3 → 3.3

I think this is really a must-have feature for WordPress, from my experience, trying to create Arabic website with WordPress, it made a lot of confusion to users cause they simply tried to make Arabic names and every time it tell them the name is wrong and never mentioned anything about language, not even a warning or a comment to say the name should be in English, so it took me a while and losing a lot of users too before I figured out that WordPress doesn't support Arabic names at all.

It's really needed fix for WordPress localization, there is no point of creating Arabic website if your users can't choose their name in Arabic :) I hope this is being considered for 3.3

#13 follow-up: @dd32
15 years ago

  • Version 3.3 → 2.3.3

Version changed from 2.3.3 to 3.3

The version field is used to track when a issue was first raised, This need not be updated to a current release upon commenting. Any version between the "Version" and "Milestone" field is considered to be affected

#14 in reply to: ↑ 13 @cupid4
15 years ago

Replying to dd32:

Version changed from 2.3.3 to 3.3

The version field is used to track when a issue was first raised, This need not be updated to a current release upon commenting. Any version between the "Version" and "Milestone" field is considered to be affected

Okay, didn't mean to mess with anything, I just thought it's the right way to promote the ticket to the version. well, any comments about the ticket subject itself?

#15 @SergeyBiryukov
15 years ago

#18666 has a workaround plugin to allow Arabic usernames.

#16 @bpetty
14 years ago

Username values related: #17793, #16833

Also, this does not appear to actually be a bug, more of a feature request / enhancement.

WP might not have been clear in the past, and may have allowed more, but there is a specific set of valid characters for usernames, and it doesn't even include the full ASCII range now. See #17793 for a patch currently open to make valid characters more clear in user creation error messages.

I think it's safe to say at this point that the username values will never support any characters outside of it's current range of characters.

#17 @nacin
14 years ago

  • Type defect (bug) → enhancement

#18 @alex-ye
14 years ago

  • Cc nashwan.doaqan@… added
  • Keywords needs-refresh added
  • Version 2.3.3

As the WordPress is a global script , non-ascii user names should be supported in the core , This ticket was opening before 5 years !

Last edited 14 years ago by alex-ye (previous) (diff)

#19 @alex-ye
14 years ago

  • Version → trunk

#20 @SergeyBiryukov
14 years ago

  • Version trunk → 2.3.3

#21 @alex-ye
14 years ago

  • Version 2.3.3

#22 @alex-ye
14 years ago

  • Version → 3.5

The problem is still exists in WordPress 3.5

#23 follow-up: @SergeyBiryukov
14 years ago

  • Version 3.5 → 2.3.3

Version number indicates when the enhancement was initially suggested. See comment:13.

#24 in reply to: ↑ 23 @alex-ye
14 years ago

Replying to SergeyBiryukov:

Version number indicates when the enhancement was initially suggested. See comment:13.

:) , Thank you for explaining .

#25 @SergeyBiryukov
14 years ago

#23238 was marked as a duplicate.

#26 @iseulde
13 years ago

Is this possible considering that usernames are used in urls like author pages? It's also worth noting that plugins might rely on the fact that the username is alphanumeric (e.g. P2's @mentions).

This is related to allowing non-ASCII post slugs and IDN support (see #10690 and #10298).

This ticket was mentioned in IRC in #wordpress-dev by SergeyBiryukov. ​View the logs.


12 years ago

#28 @SergeyBiryukov
12 years ago

#24939 was marked as a duplicate.

#29 @Clorith
10 years ago

#38325 was marked as a duplicate.

#30 @Clorith
10 years ago

#38325 was marked as a duplicate.

#31 @macmanx
10 years ago

#38325 was marked as a duplicate.

#32 @macmanx
10 years ago

#38325 was marked as a duplicate.

#33 @sachinrajcp123
15 months ago

Enhancement: Allow non-ASCII usernames by updating sanitize_user() to support Unicode letters.

#34 @dmsnell
7 months ago

#64996 was marked as a duplicate.

#35 @dmsnell
7 months ago

  • Component Users → Charset
  • Description modified (diff)
  • Type enhancement → feature request

#36 @dmsnell
7 months ago

@marshosh I hope it’s okay, but I expanded the Ticket’s description to try and convey more of the scale of the issue. Thanks for bringing this up.

This ticket was mentioned in ​PR #11133 on ​WordPress/wordpress-develop by ​@dmsnell.


7 months ago
#37

  • Keywords has-unit-tests added; needs-refresh removed

Trac ticket: Core-5918

## Status

WIP

Props dmsnell, tusharbharti, SirLouen, Mukesh Panchal.

#38 @dmsnell
7 months ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.