Skip to content

Commit 91e8a8e

Browse files
authored
Merge pull request #80 from jadenjoy/hotfix-is-json
Hotfix for is_json function.
2 parents 6cdce14 + ebcca9e commit 91e8a8e

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)