From 410fa3c9f58626149f334987996bd5a8f33d4a37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sessing=C3=B8?= Date: Tue, 18 Jul 2017 11:26:45 +0200 Subject: [PATCH] Fixed PHP 5.5 compatibility (issue: #244 - thanks @thexeos) --- src/Pecee/Http/Input/Input.php | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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