From 237b50f953f7e4a139ef60b6ad7b5186d9beb91a Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Tue, 26 May 2015 14:32:47 +0200 Subject: [PATCH] RepositoryQuery: Ensure that we'll adjust a copy of a filter --- library/Icinga/Repository/RepositoryQuery.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/Icinga/Repository/RepositoryQuery.php b/library/Icinga/Repository/RepositoryQuery.php index b25f8d00c..4d87e5026 100644 --- a/library/Icinga/Repository/RepositoryQuery.php +++ b/library/Icinga/Repository/RepositoryQuery.php @@ -185,6 +185,7 @@ class RepositoryQuery implements QueryInterface, Iterator */ public function setFilter(Filter $filter) { + $filter = clone $filter; $this->repository->requireFilter($this->target, $filter); $this->query->setFilter($filter); return $this; @@ -201,6 +202,7 @@ class RepositoryQuery implements QueryInterface, Iterator */ public function addFilter(Filter $filter) { + $filter = clone $filter; $this->repository->requireFilter($this->target, $filter); $this->query->addFilter($filter); return $this;