Skip to content

Commit b22e9c8

Browse files
committed
Used a better and more 'PHP-standard' way to check JSON decoding
1 parent 3a20c74 commit b22e9c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Symfony/src/Codebender/BuilderBundle/Controller/DefaultController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function handleRequestAction($authKey, $version)
5050

5151
$contents = json_decode($request, true);
5252

53-
if ($contents === null || $contents === false) {
53+
if (json_last_error() !== JSON_ERROR_NONE) {
5454
return new Response(json_encode(array("success" => false, "message" => "Wrong data.")));
5555
}
5656

0 commit comments

Comments
 (0)