From: garvinhicking Date: Fri, 31 Mar 2006 08:30:28 +0000 (+0000) Subject: [ 1461754 ] Permalinks broken for some UTF8 characters X-Git-Tag: 1.0~60 X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d5e2d8085fc63ae3994984b8d6430ff59e90a0c3;p=s9y.git [ 1461754 ] Permalinks broken for some UTF8 characters --- diff --git a/docs/NEWS b/docs/NEWS index 280e0a3..acdbd21 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -3,6 +3,9 @@ Version 1.0 () ------------------------------------------------------------------------ + * Fix UTF-8 encoding of $i18n_filename_* variables for building + permalinks (Bug #1461754, Thanks to Kim Sullivan) (garvinhicking) + * Fix messing up comment count when deleting a trackback from admin panel (garvinhicking) diff --git a/include/functions_permalinks.inc.php b/include/functions_permalinks.inc.php index b122843..de575a8 100644 --- a/include/functions_permalinks.inc.php +++ b/include/functions_permalinks.inc.php @@ -97,18 +97,24 @@ function serendipity_makeFilename($str, $stripDots = false) { 'y'); - if (LANG_CHARSET == 'UTF-8') { - // URLs need to be 7bit - since this function takes care of the most common ISO-8859-1 - // characters, try to UTF8-decode the string first. - $str = utf8_decode($str); - } - if (isset($GLOBALS['i18n_filename_from'])) { // Replace international chars not detected by every locale. // The array of chars is defined in the language file. $str = str_replace($GLOBALS['i18n_filename_from'], $GLOBALS['i18n_filename_to'], $str); + + if (LANG_CHARSET == 'UTF-8') { + // URLs need to be 7bit - since this function takes care of the most common ISO-8859-1 + // characters, try to UTF8-decode the string first. + $str = utf8_decode($str); + } } else { // Replace international chars not detected by every locale + if (LANG_CHARSET == 'UTF-8') { + // URLs need to be 7bit - since this function takes care of the most common ISO-8859-1 + // characters, try to UTF8-decode the string first. + $str = utf8_decode($str); + } + $str = str_replace($from, $to, $str); }