Formatting: Convert multiplication symbol to 'x' in title slugs #10659
+36
−1
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.
Trac ticket: https://core.trac.wordpress.org/ticket/64284
This PR ensures the multiplication symbol (×) and its HTML entities are consistently replaced with the letter "x" when sanitizing titles for slugs.
Users sometimes accidentally type × (U+00D7, Multiplication Sign) instead of x (U+0078, Latin Small Letter X) in post titles. The existing code only replaced the URL-encoded form (
%c3%97) after encoding, which didn't handle the character consistently in all cases.This PR adds replacement of the multiplication character and its entities before URL encoding occurs:
×××The existing replacement of
%c3%97(line 2387) is retained as a fallback for already-encoded content.Examples
iPhone 12 × 256GBiphone-12-x-256gbScreen 1920 × 1080screen-1920-x-10806×7 is 426x7-is-42Product 5×10product-5x10