Add ignore 0x09, 0x0a, 0x0d

This commit is contained in:
root
2022-07-11 12:31:43 +12:00
parent f2a58cb41f
commit e5565f89ec

View File

@@ -84,8 +84,12 @@
function decodeJSON($str, $d = 0) {
$m = array();
// eq '/[[:cntrl:]]/u';
$re = '/[\x00-\x1F\x7F]/u';
// eq '/[[:cntrl:]]/u';
// $re = '/[\x00-\x1F\x7F]/u';
// Add ignore 0x09, 0x0a, 0x0d
$re = '/[\x00-\x08\x0b-\x0c\x0e-\x1F\x7F]/u';
// $ign = array("0x09", "0x0a", "0x0d");
if(preg_match_all($re, $str, $m)) {
$tr = array();
@@ -98,6 +102,9 @@
$hex = "0x" . bin2hex($bin);
// if(in_array($hex, $ign))
// continue;
$tr[$bin] = $hex;
if($d)