summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian A. Weber2014-02-18 14:32:22 +0100
committerChristian A. Weber2014-02-18 14:32:22 +0100
commit98d31bf3d260c1d0aebe88cb35404a0338fe144f (patch)
tree39e069f3047654b2df6ddbadee7945be0d2b50b9
parent322408b21abd544d48c0026b3ce4ed7b0739192a (diff)
downloaditools-98d31bf3d260c1d0aebe88cb35404a0338fe144f.tar.gz
itools-98d31bf3d260c1d0aebe88cb35404a0338fe144f.tar.bz2
itools-98d31bf3d260c1d0aebe88cb35404a0338fe144f.zip
it::any2utf8() only warns about double utf8-encoding if $errprefix is not empty
-rw-r--r--it.class2
1 files changed, 1 insertions, 1 deletions
diff --git a/it.class b/it.class
index 2b325b8..91c10c1 100644
--- a/it.class
+++ b/it.class
@@ -436,7 +436,7 @@ static function any2utf8($value, $errprefix = "")
if (grapheme_strlen($value) === null)
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");
+ 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)), $errprefix ? "$errprefix: double utf8-encoding. 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)