- prevent from PHP error when iconv doesn't support //IGNORE (#1486375)

release-0.6
alecpl 15 years ago
parent 18cdf6b155
commit ecbd5b5d53

@ -195,7 +195,7 @@ function rcube_charset_convert($str, $from, $to=NULL)
// convert charset using iconv module
if (function_exists('iconv') && $from != 'UTF-7' && $to != 'UTF-7') {
$_iconv = iconv($from, $to . '//IGNORE', $str);
$_iconv = @iconv($from, $to . '//IGNORE', $str);
if ($_iconv !== false) {
return $_iconv;
}

@ -518,7 +518,7 @@ function rc_utf8_clean($input)
if (function_exists('mb_convert_encoding') && ($res = mb_convert_encoding($input, 'UTF-8', 'UTF-8')) !== false)
return $res;
if (function_exists('iconv') && ($res = iconv('UTF-8', 'UTF-8//IGNORE', $input)) !== false)
if (function_exists('iconv') && ($res = @iconv('UTF-8', 'UTF-8//IGNORE', $input)) !== false)
return $res;
$regexp = '/^('.

Loading…
Cancel
Save