mirror of
https://github.com/flarum/core.git
synced 2025-05-07 07:55:44 +02:00
parent
0b0f1bc142
commit
ee9862004d
@ -23,6 +23,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…
x
Reference in New Issue
Block a user