X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=functions%2Fimap_utf7_local.php;h=9a15db9b21814e3c6e5f079e14ffebaa6a5ab6c5;hb=8b096f0a2427cf0019f4dc4433a3e02b9f6f5951;hp=ecaa7ca3f03a2c9d5f0a0c20af80c29dd017d061;hpb=c23c2cd0639bba582aec4da9f612df18bf95e4ca;p=squirrelmail.git diff --git a/functions/imap_utf7_local.php b/functions/imap_utf7_local.php index ecaa7ca3..9a15db9b 100644 --- a/functions/imap_utf7_local.php +++ b/functions/imap_utf7_local.php @@ -9,16 +9,24 @@ * This implements all functions that do imap UTF7 conversions. * * $Id$ + * @package squirrelmail */ +/** + * @param string $str + * @param string $to_encoding + * @param string $from_encoding + * @param string $default_charset + * @return string + */ function sqimap_mb_convert_encoding($str, $to_encoding, $from_encoding, $default_charset) { // 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('iso-8859-',substr($default_charset,0,9)) || - stristr('utf-8',$default_charset) || - stristr('iso-2022-jp',$default_charset) ) { + if ( stristr($default_charset, 'iso-8859-') || + 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); } @@ -214,4 +222,4 @@ function decodeBASE64($s) { return $d; } -?> \ No newline at end of file +?>