Encode outgoing attachments that have lines longer than allowed per RFC. Otherwise...
[squirrelmail.git] / include / languages.php
index 8847f6170b4d86965b7a50c51e70264dab21ca17..149cce1c2344fe963c8b33fe01c02da0e9ace130 100644 (file)
@@ -52,6 +52,10 @@ function sq_change_text_domain($domain_name, $directory='') {
     global $gettext_domain;
     $return_value = $gettext_domain;
 
+    // empty domain defaults to "squirrelmail" 
+    // 
+    if (empty($domain_name)) $domain_name = 'squirrelmail';
+
     // only need to call bindtextdomain() once 
     //
     if (in_array($domain_name, $domains_already_seen)) {
@@ -336,10 +340,12 @@ function charset_convert($in_charset,$string,$out_charset,$htmlencode=true) {
  * @return string $charset Adjusted name of charset
  */
 function fixcharset($charset) {
-    /* remove minus and characters that might be used in paths from 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.
+     * Also make sure it's in lower case (ala "UTF" --> "utf")
      */
-    $charset=preg_replace("/[-:.\/\\\]/",'_',$charset);
+    $charset=preg_replace("/[-:.\/\\\]/",'_', strtolower($charset));
 
     // OE ks_c_5601_1987 > cp949
     $charset=str_replace('ks_c_5601_1987','cp949',$charset);