From cb9ccc68f7fa9d444bef4ff892407d6daa001592 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 3 Nov 2020 14:23:25 +0100 Subject: [PATCH] Url: Drop unwanted boolean parameters in method `onlyWith()` --- library/Icinga/Web/Url.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/library/Icinga/Web/Url.php b/library/Icinga/Web/Url.php index b335e8659..5a4192a68 100644 --- a/library/Icinga/Web/Url.php +++ b/library/Icinga/Web/Url.php @@ -845,9 +845,13 @@ class Url } $url = clone $this; - foreach ($url->getParams()->toArray(false) as $key => $_) { - if (! in_array($key, $keyOrArrayOfKeys, true)) { - $url->remove($key); + foreach ($url->getParams()->toArray(false) as $param => $value) { + if (is_int($param)) { + $param = $value; + } + + if (! in_array($param, $keyOrArrayOfKeys, true)) { + $url->remove($param); } }