Skip to content

Commit 19dbc16

Browse files
Update sanitize_title_with_dashes to handle additional multiplication sign encoding in 'save' context
1 parent 85df41a commit 19dbc16

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/wp-includes/formatting.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2285,7 +2285,11 @@ function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'displa
22852285
$title = preg_replace( '|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title );
22862286

22872287
// Convert multiplication sign and times entities to 'x'.
2288-
$title = str_replace( array( '×', '×', '×' ), 'x', $title );
2288+
$times_replacements = array( '×', '×', '×' );
2289+
if ( 'save' === $context ) {
2290+
$times_replacements[] = '%c3%97';
2291+
}
2292+
$title = str_replace( $times_replacements, 'x', $title );
22892293

22902294
if ( wp_is_valid_utf8( $title ) ) {
22912295
if ( function_exists( 'mb_strtolower' ) ) {
@@ -2382,9 +2386,6 @@ function sanitize_title_with_dashes( $title, $raw_title = '', $context = 'displa
23822386
'-',
23832387
$title
23842388
);
2385-
2386-
// Convert &times to 'x'.
2387-
$title = str_replace( '%c3%97', 'x', $title );
23882389
}
23892390

23902391
// Remove HTML entities.

0 commit comments

Comments
 (0)