more checks in charset name
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 1 Nov 2004 11:02:13 +0000 (11:02 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Mon, 1 Nov 2004 11:02:13 +0000 (11:02 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8308 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/i18n.php

index 3528c1cf191ec88f2bec76e60f2454aecf0edaa4..f43fb90913541922f5ce06cc4f05ba451a51d9fd 100644 (file)
@@ -200,8 +200,10 @@ function charset_convert($in_charset,$string,$out_charset,$htmlencode=true) {
  * @return string $charset Adjusted name of charset
  */
 function fixcharset($charset) {
-    // minus removed from function names
-    $charset=str_replace('-','_',$charset);
+    /* remove minus and characters that might be used in paths from charset 
+     * name in order to be able to use it in function names and include calls.
+     */
+    $charset=preg_replace("/[-:.\/\\\]/",'_',$charset);
 
     // windows-125x and cp125x charsets
     $charset=str_replace('windows_','cp',$charset);