diff options
author | Urban Müller | 2012-04-10 22:17:06 +0000 |
---|---|---|
committer | Urban Müller | 2012-04-10 22:17:06 +0000 |
commit | 57eaa2f2b7d81bdd68c7e80068cd2c9652d4a629 (patch) | |
tree | 5cd5f768397850238ddad62d3514863ec414361b | |
parent | 7b603ba54278b493d4b9704353a47cab84d00961 (diff) | |
download | itools-57eaa2f2b7d81bdd68c7e80068cd2c9652d4a629.tar.gz itools-57eaa2f2b7d81bdd68c7e80068cd2c9652d4a629.tar.bz2 itools-57eaa2f2b7d81bdd68c7e80068cd2c9652d4a629.zip |
better err msg in Q()
-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; |