Url: Drop unwanted boolean parameters in method `onlyWith()`

This commit is contained in:
Johannes Meyer 2020-11-03 14:23:25 +01:00
parent 46769b9be2
commit cb9ccc68f7
1 changed files with 7 additions and 3 deletions

View File

@ -845,9 +845,13 @@ class Url
} }
$url = clone $this; $url = clone $this;
foreach ($url->getParams()->toArray(false) as $key => $_) { foreach ($url->getParams()->toArray(false) as $param => $value) {
if (! in_array($key, $keyOrArrayOfKeys, true)) { if (is_int($param)) {
$url->remove($key); $param = $value;
}
if (! in_array($param, $keyOrArrayOfKeys, true)) {
$url->remove($param);
} }
} }