Changeset 61061
- Timestamp:
- 10/25/2025 06:22:07 PM (7 weeks ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
src/wp-includes/formatting.php (modified) (1 diff)
-
tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/formatting.php
r61053 r61061 2295 2295 2296 2296 if ( 'save' === $context ) { 2297 // Convert  , &ndash, and &mdash to hyphens.2298 $title = str_replace( array( '%c2%a0', '%e2%80%9 3', '%e2%80%94' ), '-', $title );2299 // Convert  , &ndash, and &mdash HTML entities to hyphens.2300 $title = str_replace( array( ' ', '&# 160;', '–', '–', '—', '—' ), '-', $title );2297 // Convert  , 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 ); 2299 // Convert  , non-breaking hyphen, &ndash, and &mdash HTML entities to hyphens. 2300 $title = str_replace( array( ' ', '‑', ' ', '–', '–', '—', '—' ), '-', $title ); 2301 2301 // Convert forward slash to hyphen. 2302 2302 $title = str_replace( '/', '-', $title ); -
trunk/tests/phpunit/tests/formatting/sanitizeTitleWithDashes.php
r54474 r61061 84 84 $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do – the – Dash', '', 'save' ) ); 85 85 $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do — the — Dash', '', 'save' ) ); 86 } 87 88 /** 89 * @ticket 64089 90 */ 91 public function test_replaces_non_breaking_hyphen() { 92 $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do‑the Dash', '', 'save' ) ); 93 } 94 95 /** 96 * @ticket 64089 97 */ 98 public function test_replaces_non_breaking_hyphen_entity() { 99 $this->assertSame( 'do-the-dash', sanitize_title_with_dashes( 'Do ‑ the Dash', '', 'save' ) ); 86 100 } 87 101
Note: See TracChangeset
for help on using the changeset viewer.