diff options
| author | Christian Schneider | 2025-03-25 03:15:58 +0100 |
|---|---|---|
| committer | Christian Schneider | 2025-03-25 03:15:58 +0100 |
| commit | 470fef0c3b772bf24ed161641ae9d2bd92fac4fa (patch) | |
| tree | 33cec41d07fb7e7bbbbc8988e498cc740f2f1ce5 /it.class | |
| parent | d713c9103aaeffdcf47f5ce73e2c75dac4f1b76b (diff) | |
| download | itools-470fef0c3b772bf24ed161641ae9d2bd92fac4fa.tar.gz itools-470fef0c3b772bf24ed161641ae9d2bd92fac4fa.tar.bz2 itools-470fef0c3b772bf24ed161641ae9d2bd92fac4fa.zip | |
Handle pretty printed null including newlines in it::json_decode
Diffstat (limited to 'it.class')
| -rw-r--r-- | it.class | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1263,7 +1263,7 @@ static function json_encode($data, $p = []) */ static function json_decode($json, $p = []) { - return ($data = json_decode($json, $p['assoc'])) === null && $json != 'null' ? it::error((array)$p['it_error'] + ['title' => "invalid json", 'body' => $json]) : $data; + return ($data = json_decode($json, $p['assoc'])) === null && trim($json) != 'null' ? it::error((array)$p['it_error'] + ['title' => "invalid json", 'body' => $json]) : $data; } /** |