Skip to content

Commit f51b8ec

Browse files
committed
Fix sanitization of non-breaking hyphens in sanitize_title_with_dashes
Adds URL-encoded non-breaking hyphen () to the list of characters converted to regular hyphens in sanitize_title_with_dashes() Fixes ticket #64089
1 parent 2a01f8f commit f51b8ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wp-includes/formatting.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,8 +2294,8 @@ function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'displa
22942294
$title = strtolower( $title );
22952295

22962296
if ( 'save' === $context ) {
2297-
// Convert &nbsp, &ndash, and &mdash to hyphens.
2298-
$title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-', $title );
2297+
// Convert &nbsp, &#8209 (non-breaking hyphen), &ndash, and &mdash to hyphens.
2298+
$title = str_replace( array( '%c2%a0', '%e2%80%91', '%e2%80%93', '%e2%80%94' ), '-', $title );
22992299
// Convert &nbsp, &ndash, and &mdash HTML entities to hyphens.
23002300
$title = str_replace( array( ' ', ' ', '–', '–', '—', '—' ), '-', $title );
23012301
// Convert forward slash to hyphen.

0 commit comments

Comments
 (0)