fix(JSON Parser): filter invalid control chars (github #23)

github #23
This commit is contained in:
cubic
2022-03-21 14:21:28 +08:00
parent dee260c6c2
commit 4f455a58b4

View File

@@ -300,6 +300,7 @@ class Helper
public static function parseJSON(string $json, string $delimiter = '"')
{
$json = str_replace($delimiter, '"', $json);
$json = preg_replace('/[\x01-\x1f\x7f]/', ' ', $json);
$data = json_decode($json, TRUE);
return $data;