mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00:00
Fixed Input::all when php://input is not availible
This commit is contained in:
@@ -254,7 +254,7 @@ class Input
|
|||||||
*/
|
*/
|
||||||
public function all(array $filter = null)
|
public function all(array $filter = null)
|
||||||
{
|
{
|
||||||
$output = $_GET;
|
$output = $_GET + $_POST;
|
||||||
|
|
||||||
if ($this->request->getMethod() === 'post') {
|
if ($this->request->getMethod() === 'post') {
|
||||||
|
|
||||||
@@ -263,7 +263,7 @@ class Input
|
|||||||
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 = array_merge($output, $post);
|
$output += $post;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user