0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-01-03 13:21:51 +00:00

Add shutup operator to iconv and utf_* calls.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@357 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2006-09-01 15:01:27 +00:00
parent 47a6c9eb75
commit 709a17a504

View File

@ -76,7 +76,7 @@ class HTMLPurifier_Encoder
if ($iconv && !$force_php) {
// do the shortcut way
$str = iconv('UTF-8', 'UTF-8//IGNORE', $str);
$str = @iconv('UTF-8', 'UTF-8//IGNORE', $str);
return strtr($str, $non_sgml_chars);;
}
@ -261,9 +261,9 @@ class HTMLPurifier_Encoder
$encoding = $config->get('Core', 'Encoding');
if ($encoding === 'utf-8') return $str;
if ($iconv) {
return iconv($encoding, 'utf-8//IGNORE', $str);
return @iconv($encoding, 'utf-8//IGNORE', $str);
} elseif ($encoding === 'iso-8895-1') {
return utf8_encode($str);
return @utf8_encode($str);
}
}
@ -278,9 +278,9 @@ class HTMLPurifier_Encoder
$encoding = $config->get('Core', 'Encoding');
if ($encoding === 'utf-8') return $str;
if ($iconv) {
return iconv('utf-8', $encoding . '//IGNORE', $str);
return @iconv('utf-8', $encoding . '//IGNORE', $str);
} elseif ($encoding === 'iso-8895-1') {
return utf8_encode($str);
return @utf8_encode($str);
}
}