Skip to content

Commit ebcca9e

Browse files
committed
Hotfix for is_json function. Last version of this function will return true for any number also, and will convert any big numeric string into their scientific notation.
1 parent 6cdce14 commit ebcca9e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Common/Common.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ protected static function is_json($str): bool
6060
if (!is_string($str)) {
6161
return false;
6262
}
63-
return json_decode($str, true) !== null;
63+
$json = json_decode($str);
64+
return $json && $str != $json;
6465
}
6566

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

0 commit comments

Comments
 (0)