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 b24dde7..80e4882 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 cf0d3b2..31cd0a4 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 01b8bb2..9e31662 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);
     }
 }