diff options
author | Urban Müller | 2013-09-19 22:52:00 +0000 |
---|---|---|
committer | Urban Müller | 2013-09-19 22:52:00 +0000 |
commit | 6cca6bf6150cf765631e902f1a388ab11e71737d (patch) | |
tree | ddb0739795fbe076f5d505cbf0444b6f5bb23d99 | |
parent | fadd7f279649eb987170fa56bbc2eacf7c531d78 (diff) | |
download | itools-6cca6bf6150cf765631e902f1a388ab11e71737d.tar.gz itools-6cca6bf6150cf765631e902f1a388ab11e71737d.tar.bz2 itools-6cca6bf6150cf765631e902f1a388ab11e71737d.zip |
avoid false warnings
-rw-r--r-- | it.class | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -425,8 +425,8 @@ static function any2utf8($value, $errprefix = "") list($value, $error) = array(utf8_encode($value), 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 utf8_decode($m[0]);}, $value)), "double utf8-encoding. input=$value"); - if (preg_match('/\xef\xb7|\xef\xbf/', $value)) - list($value, $error) = array(preg_replace('/\xef\xb7[\x90-\xaf]|\xef\xbf[\xbe-\xbf]/', " ", $value), "forbidden utf-8 character. input=$value"); + if (preg_match('/\xef\xb7[\x90-\xaf]|\xef\xbf[\xbe\xbf]/', $value)) + list($value, $error) = array(preg_replace('/\xef\xb7[\x90-\xaf]|\xef\xbf[\xbe\xbf]/', " ", $value), "forbidden utf-8 character. input=$value"); if ($error && $errprefix) it::error(array('title' => "$errprefix: " . trim($error))); } |