mirror of
https://github.com/flarum/framework.git
synced 2024-12-12 14:13:37 +08:00
parent
7c37320891
commit
efee030bf1
|
@ -24,6 +24,10 @@ class ReadJsonParameters implements MiddlewareInterface
|
|||
if (str_contains($request->getHeaderLine('content-type'), 'json')) {
|
||||
$input = json_decode($request->getBody(), true);
|
||||
|
||||
if (! is_array($input)) {
|
||||
$input = [];
|
||||
}
|
||||
|
||||
foreach ($input as $name => $value) {
|
||||
$request = $request->withAttribute($name, $value);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user