From 5dd42b0ffaa1a64b6d731b43e1e185531cfa03dd Mon Sep 17 00:00:00 2001 From: azett Date: Sat, 10 Sep 2022 14:20:23 +0200 Subject: [PATCH] fixes #49 & #91 - basically reverting 9f610ddac3f3a566f7ec672f5741d2314ea63ffc --- fp-includes/core/core.wp-formatting.php | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/fp-includes/core/core.wp-formatting.php b/fp-includes/core/core.wp-formatting.php index 842af80..26508e5 100644 --- a/fp-includes/core/core.wp-formatting.php +++ b/fp-includes/core/core.wp-formatting.php @@ -487,25 +487,21 @@ function sanitize_title($title, $fallback_title = '') { function sanitize_title_with_dashes($title) { $title = strip_tags($title); - - if (seems_utf8($title)) { - if (function_exists('mb_strtolower')) { - $title = mb_strtolower($title, 'UTF-8'); - } - $title = utf8_uri_encode($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); - // and finally: Kill octets - $title = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $title); // remove accents $title = remove_accents($title); + if (seems_utf8($title)) { + if (function_exists('mb_strtolower')) { + $title = mb_strtolower($title, 'UTF-8'); + } + $title = utf8_uri_encode($title); + } // title is in lower case always $title = strtolower($title);