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;
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);
}
}