diff options
author | Christian Schneider | 2012-03-28 13:03:54 +0000 |
---|---|---|
committer | Christian Schneider | 2012-03-28 13:03:54 +0000 |
commit | 52ced90c535518482618ff726eb5c512da40b203 (patch) | |
tree | 697d41cf65a60163aa5a944e8432a41271f4f42b | |
parent | b1c0b4946572027c8de564730a89ec584c830bf3 (diff) | |
download | itools-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.class | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; } /** |