diff options
| author | Urban Müller | 2026-05-13 17:20:41 +0200 |
|---|---|---|
| committer | Urban Müller | 2026-05-13 17:20:41 +0200 |
| commit | 1cfbfe0182aeba9afe0cdbf9509d495e64d40e8c (patch) | |
| tree | 6027dd13444a09847ab5459caa986628d3c9229b /it.class | |
| parent | c7e2f7de1b21a623912d27815be07941475bb8ce (diff) | |
| download | itools-1cfbfe0182aeba9afe0cdbf9509d495e64d40e8c.tar.gz itools-1cfbfe0182aeba9afe0cdbf9509d495e64d40e8c.tar.bz2 itools-1cfbfe0182aeba9afe0cdbf9509d495e64d40e8c.zip | |
grapheme_strlen can also return false on certain errors
Diffstat (limited to 'it.class')
| -rw-r--r-- | it.class | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -602,7 +602,7 @@ static function any2utf8($value, $errprefix = "") } else if (is_string($value)) { - if (grapheme_strlen($value) === null) + if (!is_int(grapheme_strlen($value))) list($value, $error) = array(it::utf8_encode($value), it::utf8_encode("incorrect utf8-encoding. input=$value")); if (preg_match('/\xc3[\x82\x83]\xc2[\x82\x83\xbc\xa9\xa4\xb6\xa8\xa2\xa0\xb4\xaa\xa7\x84\xab\xae\x9c\xaf\x96\xb2\xbb\xb9\x9f]/', $value)) list($value, $error) = array(it::any2utf8(preg_replace_callback('/\xc3[\x82\x83]\xc2[\x82\x83\xbc\xa9\xa4\xb6\xa8\xa2\xa0\xb4\xaa\xa7\x84\xab\xae\x9c\xaf\x96\xb2\xbb\xb9\x9f]/', function($m) {return it::utf8_decode($m[0]);}, $value)), $errprefix ? "double utf8-encoding. input=$value" : ""); |