1
0

Always assume UTF-8.

This commit is contained in:
2022-02-20 17:14:54 +01:00
parent b1c43491c3
commit 4785f07f12
61 changed files with 110 additions and 278 deletions

View File

@ -175,20 +175,16 @@ function serendipity_makeFilename($str, $stripDots = false) {
// 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);
}
// 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
$str = str_replace($from, $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);
}
// 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);
}
// Nuke chars not allowed in our URI
@ -857,4 +853,4 @@ function serendipity_getUriArguments($uri, $wildcard = false) {
} else {
return array();
}
}
}