mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 08:12:18 +00:00
The input()->all method will now set every key specified in the filter. If the key doesn't exist it will be set to null.
This commit is contained in:
@@ -303,13 +303,22 @@ class InputHandler
|
|||||||
// Append any PHP-input json
|
// Append any PHP-input json
|
||||||
if (strpos(trim($contents), '{') === 0) {
|
if (strpos(trim($contents), '{') === 0) {
|
||||||
$post = json_decode($contents, true);
|
$post = json_decode($contents, true);
|
||||||
|
|
||||||
if ($post !== false) {
|
if ($post !== false) {
|
||||||
$output += $post;
|
$output += $post;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (\count($filter) > 0) ? array_intersect_key($output, array_flip($filter)) : $output;
|
$output = (\count($filter) > 0) ? array_intersect_key($output, array_flip($filter)) : $output;
|
||||||
|
|
||||||
|
foreach ($filter as $value) {
|
||||||
|
if (!array_key_exists($value, $output)) {
|
||||||
|
$output[$value] = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return $output;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user