Adding some CS fixes#2
Open
SirLouen wants to merge 13 commits intoarnt:support-rfc6530arnt/wordpress-develop:support-rfc6530from
Open
Adding some CS fixes#2SirLouen wants to merge 13 commits intoarnt:support-rfc6530arnt/wordpress-develop:support-rfc6530from
SirLouen wants to merge 13 commits intoarnt:support-rfc6530arnt/wordpress-develop:support-rfc6530from
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
172067a to
1514f31
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adding some additional CS fixes to the tests