diff options
Diffstat (limited to 'it_html.class')
-rw-r--r-- | it_html.class | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/it_html.class b/it_html.class index 0f18996..193fc89 100644 --- a/it_html.class +++ b/it_html.class @@ -500,7 +500,10 @@ function Q($string) if ($GLOBALS['debug_utf8check'] && $GLOBALS['it_html']->p['charset'] == "utf-8") $string = self::fix_encoding($string); - $string = htmlspecialchars($GLOBALS['it_html']->p['charset'] == "iso-8859-1" ? it_html::latinize($string) : $string, ENT_COMPAT, $GLOBALS['it_html']->p['charset']); + $origstring = $string; + $string = @htmlspecialchars($GLOBALS['it_html']->p['charset'] == "iso-8859-1" ? it_html::latinize($string) : $string, ENT_COMPAT, $GLOBALS['it_html']->p['charset']); + if ($string === "" && $origstring) + it::error("invalid utf-8 '$origstring'"); } return $GLOBALS['debug_q'] && $string ? "<span style='background:#8FF'>$string</span>" : $string; |