[icinga-checkins] icinga.org: icingaweb2-module-director/master: CustomVariables: clone values on set...

git at icinga.org git at icinga.org
Tue Feb 23 03:15:19 CET 2016


Module: icingaweb2-module-director
Branch: master
Commit: febd44a3184feb08f91ad5d5e1caed088e7a2e5a
URL:    https://git.icinga.org/?p=icingaweb2-module-director.git;a=commit;h=febd44a3184feb08f91ad5d5e1caed088e7a2e5a

Author: Thomas Gelf <thomas at gelf.net>
Date:   Mon Feb 22 10:59:30 2016 +0100

CustomVariables: clone values on set...

...just to be on the safe side

---

 library/Director/CustomVariable/CustomVariables.php |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/library/Director/CustomVariable/CustomVariables.php b/library/Director/CustomVariable/CustomVariables.php
index 4c5d490..ab27a8a 100644
--- a/library/Director/CustomVariable/CustomVariables.php
+++ b/library/Director/CustomVariable/CustomVariables.php
@@ -67,7 +67,9 @@ class CustomVariables implements Iterator, Countable, IcingaConfigRenderer
     {
         $key = (string) $key;
 
-        if (! $value instanceof CustomVariable) {
+        if ($value instanceof CustomVariable) {
+            $value = clone($value);
+        } else {
             $value = CustomVariable::create($key, $value);
         }
 



More information about the icinga-checkins mailing list