From 91ab0c08e54acc2f01d21b3b937bff99f0461c43 Mon Sep 17 00:00:00 2001 From: garvinhicking Date: Fri, 31 Mar 2006 08:30:15 +0000 Subject: [PATCH] fix bug: [ 1461754 ] Permalinks broken for some UTF8 characters --- docs/NEWS | 3 +++ include/functions_permalinks.inc.php | 18 ++++++++++++------ 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/docs/NEWS b/docs/NEWS index 0207532..1ebda64 100644 --- a/docs/NEWS +++ b/docs/NEWS @@ -51,6 +51,9 @@ Version 1.1-alpha1() 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); } -- 2.39.5