Skip to content

Commit

Permalink
Merge pull request #80 from jadenjoy/hotfix-is-json
Browse files Browse the repository at this point in the history
Hotfix for is_json function.
  • Loading branch information
mavinoo authored Dec 19, 2021
2 parents 6cdce14 + ebcca9e commit 91e8a8e
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 91e8a8e

Please sign in to comment.