diff --git a/composer.json b/composer.json index 3412fd4..879566f 100644 --- a/composer.json +++ b/composer.json @@ -2,11 +2,14 @@ "name": "pecee/simple-router", "description": "Simple, fast PHP router that is easy to get integrated and in almost any project. Heavily inspired by the Laravel router.", "keywords": [ + "router", "router", "routing", + "route", + "simple-php-router", "laravel", "pecee", - "route" + "php" ], "license": "MIT", "support": { diff --git a/src/Pecee/Http/Input/Input.php b/src/Pecee/Http/Input/Input.php index 0bd5ec1..e34d05c 100644 --- a/src/Pecee/Http/Input/Input.php +++ b/src/Pecee/Http/Input/Input.php @@ -283,15 +283,7 @@ class Input } } - $output = array_merge($_GET, $output); - - if ($filter !== null) { - $output = array_filter($output, function ($key) use ($filter) { - return (in_array($key, $filter) === true); - }, ARRAY_FILTER_USE_KEY); - } - - return $output; + return ($filter !== null) ? array_intersect_key($output, array_flip($filter)) : array_merge($_GET, $output); } } \ No newline at end of file