Skip to content

Conversation

@SirLouen
Copy link

@SirLouen SirLouen commented Nov 5, 2025

Adding some additional CS fixes to the tests

arnt and others added 13 commits September 29, 2025 22:21
This adds support for the unicode address extensions in RFC 6532, adds
unit tests for that, extends the documentation to explain the relationship
between this code and the various specifications, and finally adds unit
tests to ensure that the documentation's description of the code remains
correct.

Fixes #31992.
This accepts user names that contain a single script, but not mixed-script
names, such as ones that mix Latin and Cyrillic. That seemed to be closest
to the code's existing philosophy.

Since PHP 7.2 and 7.3 don't offer mb_str_split, this change leaves sites
on those versions of PHP with ASCII-only user names.
 - Existing user names continue to work unchanged even on 7.2/7.3
 - adding new non-ASCII user names requires 7.4
 - autocorrection requires 7.4 (e.g. user'@example.com -> user@example.com)
Until now, WordPress generated all-ASCII slugs, which works well for
mostly-ASCII languages. Now that WordPress supports scripts like
Devanagari much better, it's necessary to test the slug support for
Devanagari. What WordPress did until now works well for Devanagari, so
this commit merely adds a unit test.

The ideal is to have links such as
	<hebrewdomain>.<hebrewtld>/<hebrewpath>
which is shown onscreen as
	<hebrewpath>/<hebrewtld>.<hebrewdomain>
without any switches between right-to-left Hebrew and left-to-right Latin.
/author/ and a few others don't achieve that ideal. Yet.

Note that there is a rare existing bug: The existing mapping to ASCII can
produce the same slug for two pages, since two letters can map to e.g.
'L'. This seems unfixable, since any change might break existing links,
but happily also extremely rare.
Suggested by Mukesh Panchal.

I also added some tests for sanitize_email, for which there were none
before. They didn't break, I just felt that having some is better than
having none.
No behaviour changes are needed due to these tests, but the test code
should capture the reasons for rejecting some of these addresses, so this
commit adds tests and comments.

Props tusharbharti.
@github-actions
Copy link

github-actions bot commented Nov 5, 2025

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props sirlouen.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@arnt arnt force-pushed the support-rfc6530 branch 2 times, most recently from 697aa9f to 7b7e00c Compare December 10, 2025 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants