summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Schneider2012-03-28 13:03:54 +0000
committerChristian Schneider2012-03-28 13:03:54 +0000
commit52ced90c535518482618ff726eb5c512da40b203 (patch)
tree697d41cf65a60163aa5a944e8432a41271f4f42b
parentb1c0b4946572027c8de564730a89ec584c830bf3 (diff)
downloaditools-52ced90c535518482618ff726eb5c512da40b203.tar.gz
itools-52ced90c535518482618ff726eb5c512da40b203.tar.bz2
itools-52ced90c535518482618ff726eb5c512da40b203.zip
Replace htmlspecialchars side effect with grapheme_strlen returning null on invalid utf-8
-rw-r--r--it.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it.class b/it.class
index 6d516c9..b4a0d9e 100644
--- a/it.class
+++ b/it.class
@@ -416,7 +416,7 @@ static function grep($pattern, $array, $p = array())
*/
function any2utf8($value)
{
- return strlen($value) && strlen(htmlspecialchars($value, 0, 'utf-8')) == 0 ? utf8_encode($value) : $value; # Use side-effect of htmlspecialchars: Fails if not valid utf-8 encoding
+ return grapheme_strlen($value) === null ? utf8_encode($value) : $value;
}
/**