mirror of
https://github.com/flarum/core.git
synced 2025-05-11 18:05:29 +02:00
parent
0b0f1bc142
commit
ee9862004d
@ -24,6 +24,10 @@ class ReadJsonParameters implements MiddlewareInterface
|
|||||||
if (str_contains($request->getHeaderLine('content-type'), 'json')) {
|
if (str_contains($request->getHeaderLine('content-type'), 'json')) {
|
||||||
$input = json_decode($request->getBody(), true);
|
$input = json_decode($request->getBody(), true);
|
||||||
|
|
||||||
|
if (! is_array($input)) {
|
||||||
|
$input = [];
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($input as $name => $value) {
|
foreach ($input as $name => $value) {
|
||||||
$request = $request->withAttribute($name, $value);
|
$request = $request->withAttribute($name, $value);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user