X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fimap_utf7_local.php;h=86acabb73c328c4e998486832afec439cf5bfd66;hb=eb548244cf42565bbad450f308b760d3b6c2fc94;hp=e4c431096542fda8171fd031c71e1660dfb186f4;hpb=eb19bc676326931545976b817f594025ed13eec0;p=squirrelmail.git diff --git a/functions/imap_utf7_local.php b/functions/imap_utf7_local.php index e4c43109..86acabb7 100644 --- a/functions/imap_utf7_local.php +++ b/functions/imap_utf7_local.php @@ -22,11 +22,11 @@ */ function sqimap_mb_convert_encoding($str, $to_encoding, $from_encoding, $default_charset) { - // Allows mbstring functions only with iso-8859-*, utf-8 and + // Allows mbstring functions only with iso-8859-*, utf-8 and // iso-2022-jp (Japanese) // koi8-r and gb2312 can be added only in php 4.3+ if ( stristr($default_charset, 'iso-8859-') || - stristr($default_charset, 'utf-8') || + stristr($default_charset, 'utf-8') || stristr($default_charset, 'iso-2022-jp') ) { if (function_exists('mb_convert_encoding')) { return mb_convert_encoding($str, $to_encoding, $from_encoding); @@ -37,10 +37,10 @@ function sqimap_mb_convert_encoding($str, $to_encoding, $from_encoding, $default function imap_utf7_encode_local($s) { global $languages, $squirrelmail_language; - + if (isset($languages[$squirrelmail_language]['XTRA_CODE']) && - function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) { - return $languages[$squirrelmail_language]['XTRA_CODE']('utf7-imap_encode', $s); + function_exists($languages[$squirrelmail_language]['XTRA_CODE'].'_utf7_imap_encode')) { + return call_user_func($languages[$squirrelmail_language]['XTRA_CODE'] . '_utf7_imap_encode', $s); } if ($s == '') //If empty, don't bother @@ -54,8 +54,8 @@ function imap_utf7_encode_local($s) { return $utf7_s; } - // Later code works only for ISO-8859-1 - + // Later code works only for ISO-8859-1 + $b64_s = ''; // buffer for substring to be base64-encoded $utf7_s = ''; // imap-utf7-encoded string for ($i = 0; $i < strlen($s); $i++) { @@ -90,10 +90,10 @@ function imap_utf7_encode_local($s) { function imap_utf7_decode_local($s) { global $languages, $squirrelmail_language; - + if (isset($languages[$squirrelmail_language]['XTRA_CODE']) && - function_exists($languages[$squirrelmail_language]['XTRA_CODE'])) { - return $languages[$squirrelmail_language]['XTRA_CODE']('utf7-imap_decode', $s); + function_exists($languages[$squirrelmail_language]['XTRA_CODE'] . '_utf7_imap_decode')) { + return call_user_func($languages[$squirrelmail_language]['XTRA_CODE'] . '_utf7_imap_decode', $s); } if ($s == '') //If empty, don't bother @@ -108,7 +108,7 @@ function imap_utf7_decode_local($s) { } // Later code works only for ISO-8859-1 - + $b64_s = ''; $iso_8859_1_s = ''; for ($i = 0, $len = strlen($s); $i < $len; $i++) { @@ -223,4 +223,4 @@ function decodeBASE64($s) { return $d; } -?> +?> \ No newline at end of file