Skip to content

Commit 8a2fc2e

Browse files
GrahamCampbellkattrali
authored andcommitted
fall through when JSON parsing fails (#33)
1 parent 934ad70 commit 8a2fc2e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Request/SymfonyRequest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,9 @@ protected function getInput()
9999

100100
// If it's json, decode it
101101
if (stripos($type, '/json') !== false || stripos($type, '+json') !== false) {
102-
return json_decode($this->request->getContent(), true);
102+
if (is_array($parsed = json_decode($this->request->getContent(), true))) {
103+
return $parsed;
104+
}
103105
}
104106

105107
// Yes, we really do want request->request

0 commit comments

Comments
 (0)