]> git.mjollnir.org Git - s9y.git/commitdiff
[ 1461754 ] Permalinks broken for some UTF8 characters
authorgarvinhicking <garvinhicking>
Fri, 31 Mar 2006 08:30:28 +0000 (08:30 +0000)
committergarvinhicking <garvinhicking>
Fri, 31 Mar 2006 08:30:28 +0000 (08:30 +0000)
docs/NEWS
include/functions_permalinks.inc.php

index 280e0a39ea4877cd6681dcd134aa22910838c568..acdbd2120560559ccc8027b3553d548cac5020e8 100644 (file)
--- 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)
 
index b12284352abe7aeb673c905a8cd4a44355ec3aa6..de575a870f2bd6878a7b4206803bdf2c9f9f1cd6 100644 (file)
@@ -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);
     }