-
Notifications
You must be signed in to change notification settings - Fork 0
Adding some CS fixes #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: support-rfc6530
Are you sure you want to change the base?
Conversation
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.
Related to #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.
|
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 Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
4498e43 to
3dc24ca
Compare
697aa9f to
7b7e00c
Compare
Adding some additional CS fixes to the tests