Skip to content

Commit f9d35ce

Browse files
committed
Fixing exception in case of invalid POST body.
1 parent 814a4f5 commit f9d35ce

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Routing/QueryRouteEnhancer.php

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ protected function filterRequestValues(Request $request, callable $filter) {
140140
$content = $request->getContent();
141141

142142
$values = !empty($content) ? json_decode($content, TRUE) : $request->query->all();
143+
$values = !empty($values) ? $values : [];
143144

144145
// PHP 5.5.x does not yet support the ARRAY_FILTER_USE_KEYS constant.
145146
$keys = array_filter(array_keys($values), $filter);

0 commit comments

Comments
 (0)