[icinga-checkins] icinga.org: icingaweb2-module-director/master: ExtensibleSet: respect strings when filtering

git at icinga.org git at icinga.org
Fri May 20 10:46:20 CEST 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Fri May 20 10:46:01 2016 +0200

ExtensibleSet: respect strings when filtering

---

 library/Director/Web/Form/Element/ExtensibleSet.php |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/library/Director/Web/Form/Element/ExtensibleSet.php b/library/Director/Web/Form/Element/ExtensibleSet.php
index 12f6134..1d252af 100644
--- a/library/Director/Web/Form/Element/ExtensibleSet.php
+++ b/library/Director/Web/Form/Element/ExtensibleSet.php
@@ -32,9 +32,12 @@ class ExtensibleSet extends FormElement
 
     protected function _filterValue(&$value, &$key)
     {
-        if ($value !== null) {
+        if (is_array($value)) {
             $value = array_filter($value, 'strlen');
+        } elseif (is_string($value) && !strlen($value)) {
+            $value = null;
         }
+
         return parent::_filterValue($value, $key);
     }
 



More information about the icinga-checkins mailing list