diff --git a/wp-includes/functions-formatting.php b/wp-includes/functions-formatting.php index 3e5448c433..277920c2a6 100644 --- a/wp-includes/functions-formatting.php +++ b/wp-includes/functions-formatting.php @@ -78,6 +78,47 @@ function wpautop($pee, $br = 1) { return $pee; } + +function seems_utf8($Str) { # by bmorel at ssi dot fr + for ($i=0; $i 'OE', chr(197).chr(147) => 'oe', chr(197).chr(160) => 'S', chr(197).chr(189) => 'Z', chr(197).chr(161) => 's', chr(197).chr(190) => 'z', chr(226).chr(130).chr(172) => 'E'); + $string = utf8_decode(strtr($string, $invalid_latin_chars)); + } + $string = strtr($string, $chars['in'], $chars['out']); + $double_chars['in'] = array(chr(140), chr(156), chr(198), chr(208), chr(222), chr(223), chr(230), chr(240), chr(254)); + $double_chars['out'] = array('OE', 'oe', 'AE', 'DH', 'TH', 'ss', 'ae', 'dh', 'th'); + $string = str_replace($double_chars['in'], $double_chars['out'], $string); + return $string; +} + function sanitize_title($title) { $title = do_action('sanitize_title', $title); @@ -85,6 +126,7 @@ function sanitize_title($title) { } function sanitize_title_with_dashes($title) { + $title = remove_accents($title); $title = strtolower($title); $title = preg_replace('/&.+?;/', '', $title); // kill entities $title = preg_replace('/[^a-z0-9 _-]/', '', $title);