xtra_code updates in compose, readbody and view_text scripts
authortokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 8 Aug 2004 15:02:24 +0000 (15:02 +0000)
committertokul <tokul@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sun, 8 Aug 2004 15:02:24 +0000 (15:02 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7857 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/compose.php
src/read_body.php
src/view_text.php

index b24dde7cd0f9c22a53643a75b1e3fbf8863f0b64..80e488260a348ac7c2be73ef7a127ed94b0b4ac4 100644 (file)
@@ -631,9 +631,9 @@ function newMail ($mailbox='', $passed_id='', $passed_ent_id='', $action='', $se
                 $bodypart = strip_tags($bodypart);
             }
             if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
-                function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
+                function_exists($languages[$squirrelmail_language]['XTRA_CODE'] . '_decode')) {
                 if (mb_detect_encoding($bodypart) != 'ASCII') {
-                    $bodypart = $languages[$squirrelmail_language]['XTRA_CODE']('decode', $bodypart);
+                    $bodypart = call_user_func($languages[$squirrelmail_language]['XTRA_CODE'] . '_decode', $bodypart);
                 }
             }
 
@@ -840,8 +840,8 @@ function getAttachments($message, &$composeMessage, $passed_id, $entities, $imap
            }
            $filename = str_replace('&#32;', ' ', decodeHeader($filename));
            if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
-               function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
-                $filename =  $languages[$squirrelmail_language]['XTRA_CODE']('encode', $filename);
+               function_exists($languages[$squirrelmail_language]['XTRA_CODE'] . '_encode')) {
+                $filename =  call_user_func($languages[$squirrelmail_language]['XTRA_CODE'] . '_encode', $filename);
            }
            $localfilename = GenerateRandomString(32, '', 7);
            $full_localfilename = "$hashed_attachment_dir/$localfilename";
index cf0d3b2f9bb6bfd5fd983385d7f621eaf0a528ac..31cd0a47c74b481bc5ce32a82c59f4498ec01dd1 100644 (file)
@@ -192,8 +192,8 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
 
     $special_encoding = '';
     if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
-        function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
-        $body = $languages[$squirrelmail_language]['XTRA_CODE']('encode', $body);
+        function_exists($languages[$squirrelmail_language]['XTRA_CODE'] . '_encode')) {
+        $body = call_user_func($languages[$squirrelmail_language]['XTRA_CODE'] . '_encode', $body);
         if (strtolower($default_charset) == 'iso-2022-jp') {
             if (mb_detect_encoding($body) == 'ASCII') {
                 $special_encoding = '8bit';
index 01b8bb2a2b10ac71a47bf9dc5a3553cfeb07a02b..9e316625b1f7d9ecbb8eaac8002c7fba91ca25ea 100644 (file)
@@ -64,9 +64,9 @@ $body = mime_fetch_body($imapConnection, $passed_id, $ent_id);
 $body = decodeBody($body, $encoding);
 
 if (isset($languages[$squirrelmail_language]['XTRA_CODE']) &&
-    function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) {
+    function_exists($languages[$squirrelmail_language]['XTRA_CODE'].'_decode')) {
     if (mb_detect_encoding($body) != 'ASCII') {
-        $body = $languages[$squirrelmail_language]['XTRA_CODE']('decode', $body);
+        $body = call_user_func($languages[$squirrelmail_language]['XTRA_CODE'] . '_decode', $body);
     }
 }