[icinga-checkins] icinga.org: icingaweb2-module-director/master: ExtensibleSet: remove empty strings at filter time

git at icinga.org git at icinga.org
Fri May 20 08:48:38 CEST 2016


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

Author: Thomas Gelf <thomas at gelf.net>
Date:   Fri May 20 08:13:13 2016 +0200

ExtensibleSet: remove empty strings at filter time

---

 library/Director/Web/Form/Element/ExtensibleSet.php |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/library/Director/Web/Form/Element/ExtensibleSet.php b/library/Director/Web/Form/Element/ExtensibleSet.php
index d17d978..a5af245 100644
--- a/library/Director/Web/Form/Element/ExtensibleSet.php
+++ b/library/Director/Web/Form/Element/ExtensibleSet.php
@@ -30,6 +30,12 @@ class ExtensibleSet extends FormElement
         return $value;
     }
 
+    protected function _filterValue(&$value, &$key)
+    {
+        $value = array_filter($value, 'strlen');
+        return parent::_filterValue($value, $key);
+    }
+
     public function isValid($value, $context = null)
     {
         if ($value === null) {



More information about the icinga-checkins mailing list