Skip to content

Commit

Permalink
Hotfix for is_json function. Last version of this function will retur…
Browse files Browse the repository at this point in the history
…n true for any number also, and will convert any big numeric string into their scientific notation.
  • Loading branch information
jadenjoy committed Dec 18, 2021
1 parent 6cdce14 commit ebcca9e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Common/Common.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ protected static function is_json($str): bool
if (!is_string($str)) {
return false;
}
return json_decode($str, true) !== null;
$json = json_decode($str);
return $json && $str != $json;
}

protected static function safeJson($jsonData, $asArray = false)
Expand Down

0 comments on commit ebcca9e

Please sign in to comment.