1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-04 13:18:00 +02:00

Do checks against iconvAvailable because PHP 5.4 has botched iconv support.

Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
This commit is contained in:
Edward Z. Yang
2012-10-27 02:27:57 -07:00
parent 83a574491e
commit c0ad68108a
4 changed files with 17 additions and 9 deletions

View File

@@ -355,7 +355,12 @@ class HTMLPurifier_Encoder
$str = utf8_encode($str);
return $str;
}
trigger_error('Encoding not supported, please install iconv', E_USER_ERROR);
$bug = HTMLPurifier_Encoder::testIconvTruncateBug();
if ($bug == self::ICONV_OK) {
trigger_error('Encoding not supported, please install iconv', E_USER_ERROR);
} else {
trigger_error('You have a buggy version of iconv, see https://bugs.php.net/bug.php?id=48147 and http://sourceware.org/bugzilla/show_bug.cgi?id=13541', E_USER_ERROR);
}
}
/**