From eba862a290485bc2cab762b3c351554891c07564 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 9 Jun 2015 09:21:12 +0200 Subject: [PATCH] view->url(): Clone $path if it's already of type Icinga\Web\Url Avoids side effects in case of url params adjustments. fixes #9351 --- library/Icinga/Web/View/helpers/url.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/library/Icinga/Web/View/helpers/url.php b/library/Icinga/Web/View/helpers/url.php index 39e8de951..06ace7f19 100644 --- a/library/Icinga/Web/View/helpers/url.php +++ b/library/Icinga/Web/View/helpers/url.php @@ -20,7 +20,12 @@ $this->addHelperFunction('url', function ($path = null, $params = null) { } else { $url = Url::fromPath($path); } + if ($params !== null) { + if ($url === $path) { + $url = clone $url; + } + $url->overwriteParams($params); }