alecpl
2010-01-13 ecbd5b5d53a9d9d8d24c84dcf2ebf7682f77107d
- prevent from PHP error when iconv doesn't support //IGNORE (#1486375)


2 files modified
4 ■■■■ changed files
program/include/main.inc 2 ●●● patch | view | raw | blame | history
program/include/rcube_shared.inc 2 ●●● patch | view | raw | blame | history
program/include/main.inc
@@ -195,7 +195,7 @@
  // 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;
    }
program/include/rcube_shared.inc
@@ -518,7 +518,7 @@
  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 = '/^('.