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:
Ryan Boren 2005-02-01 08:31:13 +00:00
parent 521a1b9707
commit 22f48d88c0
1 changed files with 7 additions and 1 deletions

View File

@ -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')) {