From c17ccc5490ab5e53d1eab5889b42c2e90cce032f Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 4 Mar 2022 14:11:02 +0000 Subject: [PATCH] Docs: Add inline comments for non-visible characters in `sanitize_title_with_dashes()`. This aims to clarify the list of characters that are stripped from URLs or converted to a hyphen. Follow-up to [51984]. See #47912, #54729. Built from https://develop.svn.wordpress.org/trunk@52821 git-svn-id: http://core.svn.wordpress.org/trunk@52410 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/formatting.php | 50 +++++++++++++++++++------------------- wp-includes/version.php | 2 +- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index e5058744e1..32a8b86bb1 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -2308,17 +2308,17 @@ function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'displa '%cc%84', '%cc%8c', // Non-visible characters that display without a width. - '%e2%80%8b', - '%e2%80%8c', - '%e2%80%8d', - '%e2%80%8e', - '%e2%80%8f', - '%e2%80%aa', - '%e2%80%ab', - '%e2%80%ac', - '%e2%80%ad', - '%e2%80%ae', - '%ef%bb%bf', + '%e2%80%8b', // Zero width space. + '%e2%80%8c', // Zero width non-joiner. + '%e2%80%8d', // Zero width joiner. + '%e2%80%8e', // Left-to-right mark. + '%e2%80%8f', // Right-to-left mark. + '%e2%80%aa', // Left-to-right embedding. + '%e2%80%ab', // Right-to-left embedding. + '%e2%80%ac', // Pop directional formatting. + '%e2%80%ad', // Left-to-right override. + '%e2%80%ae', // Right-to-left override. + '%ef%bb%bf', // Byte order mark. ), '', $title @@ -2327,20 +2327,20 @@ function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'displa // Convert non-visible characters that display with a width to hyphen. $title = str_replace( array( - '%e2%80%80', - '%e2%80%81', - '%e2%80%82', - '%e2%80%83', - '%e2%80%84', - '%e2%80%85', - '%e2%80%86', - '%e2%80%87', - '%e2%80%88', - '%e2%80%89', - '%e2%80%8a', - '%e2%80%a8', - '%e2%80%a9', - '%e2%80%af', + '%e2%80%80', // En quad. + '%e2%80%81', // Em quad. + '%e2%80%82', // En space. + '%e2%80%83', // Em space. + '%e2%80%84', // Three-per-em space. + '%e2%80%85', // Four-per-em space. + '%e2%80%86', // Six-per-em space. + '%e2%80%87', // Figure space. + '%e2%80%88', // Punctuation space. + '%e2%80%89', // Thin space. + '%e2%80%8a', // Hair space. + '%e2%80%a8', // Line separator. + '%e2%80%a9', // Paragraph separator. + '%e2%80%af', // Narrow no-break space. ), '-', $title diff --git a/wp-includes/version.php b/wp-includes/version.php index 65f53fd4bc..9199e7b0ec 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52820'; +$wp_version = '6.0-alpha-52821'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.