Don't stomp the percent in escaped octets.
git-svn-id: https://develop.svn.wordpress.org/trunk@2189 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
521a1b9707
commit
22f48d88c0
|
@ -217,7 +217,13 @@ function sanitize_title($title, $fallback_title = '') {
|
|||
|
||||
function sanitize_title_with_dashes($title) {
|
||||
$title = strip_tags($title);
|
||||
$title = preg_replace('|%|', '', $title);
|
||||
// Preserve escaped octets.
|
||||
$title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '---$1---', $title);
|
||||
// Remove percent signs that are not part of an octet.
|
||||
$title = str_replace('%', '', $title);
|
||||
// Restore octets.
|
||||
$title = preg_replace('|---([a-fA-F0-9][a-fA-F0-9])---|', '%$1', $title);
|
||||
|
||||
$title = remove_accents($title);
|
||||
if (seems_utf8($title)) {
|
||||
if (function_exists('mb_strtolower')) {
|
||||
|
|
Loading…
Reference in New Issue