diff --git a/externals/jsonlint/src/Seld/JsonLint/JsonParser.php b/externals/jsonlint/src/Seld/JsonLint/JsonParser.php index 7100abfa..ed3106ea 100644 --- a/externals/jsonlint/src/Seld/JsonLint/JsonParser.php +++ b/externals/jsonlint/src/Seld/JsonLint/JsonParser.php @@ -481,7 +481,7 @@ class JsonLintJsonParser // UTF-8 ByteOrderMark sequence $bom = "\xEF\xBB\xBF"; - if (substr($input, 0, 3) === $bom) { + if ($input && (substr($input, 0, 3) === $bom)) { $this->parseError("BOM detected, make sure your input does not include a Unicode Byte-Order-Mark", array()); } } diff --git a/externals/jsonlint/src/Seld/JsonLint/Lexer.php b/externals/jsonlint/src/Seld/JsonLint/Lexer.php index 4197afe1..d002b580 100644 --- a/externals/jsonlint/src/Seld/JsonLint/Lexer.php +++ b/externals/jsonlint/src/Seld/JsonLint/Lexer.php @@ -94,7 +94,7 @@ class JsonLintLexer public function getUpcomingInput() { $next = $this->match; - if (strlen($next) < 20) { + if ($this->input !== null && strlen($next) < 20) { $next .= substr($this->input, 0, 20 - strlen($next)); } @@ -128,6 +128,9 @@ class JsonLintLexer $rules = $this->getCurrentRules(); $rulesLen = count($rules); + if (!isset($this->input)) { + $this->input = ''; + } for ($i=0; $i < $rulesLen; $i++) { if (preg_match($this->rules[$rules[$i]], $this->input, $match)) { preg_match_all('/\n.*/', $match[0], $lines);