Replacing tabs with spaces, trimming white space at EOL and newline at EOF
[squirrelmail.git] / functions / i18n.php
index 3528c1cf191ec88f2bec76e60f2454aecf0edaa4..58395b5c381fc1e35d3326163397defca2fa8b25 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);
@@ -297,8 +299,8 @@ function set_up_language($sm_language, $do_search = false, $default = false) {
         }
         setlocale(LC_ALL, $longlocale);
         // Workaround for plugins that use numbers with floating point
-        // It might be removed if plugins use correct decimal delimiters 
-       // according to locale settings.
+        // It might be removed if plugins use correct decimal delimiters
+        // according to locale settings.
         setlocale(LC_NUMERIC, 'C');
         // Workaround for specific Turkish strtolower/strtoupper rules.
         // Many functions expect English conversion rules.
@@ -715,7 +717,7 @@ function is_conversion_safe($input_charset) {
   global $languages, $sm_notAlias, $default_charset, $lossy_encoding;
 
     if (isset($lossy_encoding) && $lossy_encoding )
-       return true;
+        return true;
 
  // convert to lower case
  $input_charset = strtolower($input_charset);