summaryrefslogtreecommitdiff
path: root/it_html.class
diff options
context:
space:
mode:
authorUrban Müller2012-04-10 22:17:06 +0000
committerUrban Müller2012-04-10 22:17:06 +0000
commit57eaa2f2b7d81bdd68c7e80068cd2c9652d4a629 (patch)
tree5cd5f768397850238ddad62d3514863ec414361b /it_html.class
parent7b603ba54278b493d4b9704353a47cab84d00961 (diff)
downloaditools-57eaa2f2b7d81bdd68c7e80068cd2c9652d4a629.tar.gz
itools-57eaa2f2b7d81bdd68c7e80068cd2c9652d4a629.tar.bz2
itools-57eaa2f2b7d81bdd68c7e80068cd2c9652d4a629.zip
better err msg in Q()
Diffstat (limited to 'it_html.class')
-rw-r--r--it_html.class5
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;