[wp-trac] [WordPress Trac] #31790: sanitize_title_with_dashes() has issues with non breaking space ( and   ) (was: Slug/Permalink has issues with non breaking space ( and   ))
WordPress Trac
noreply at wordpress.org
Fri Oct 16 11:26:27 UTC 2015
#31790: sanitize_title_with_dashes() has issues with non breaking space ( and
)
--------------------------+-----------------------------
Reporter: michelski | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Formatting | Version: 4.1.1
Severity: normal | Resolution:
Keywords: needs-patch | Focuses:
--------------------------+-----------------------------
Changes (by swissspidy):
* keywords: => needs-patch
* component: Permalinks => Formatting
* milestone: Awaiting Review => Future Release
Comment:
This bug still exists in trunk.
The problem is [https://core.trac.wordpress.org/browser/trunk/src/wp-
includes/formatting.php#L1582 this line] in
`sanitize_title_with_dashes()`:
{{{
$title = preg_replace('/&.+?;/', '', $title); // kill entities
}}}
A bit further down, we'll see:
{{{
// Convert nbsp, ndash and mdash to hyphens
$title = str_replace( array( '%c2%a0', '%e2%80%93', '%e2%80%94' ), '-',
$title );
}}}
This should be extended to replace the characters mentioned here.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/31790#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list