From dca6cc8a013b6aaa8c0640fee21b6b65de0c9f62 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Fri, 20 May 2016 10:46:01 +0200 Subject: [PATCH] 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 12f6134b..1d252af9 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); }