ExtensibleSet: respect strings when filtering

This commit is contained in:
Thomas Gelf 2016-05-20 10:46:01 +02:00
parent eb52918711
commit dca6cc8a01
1 changed files with 4 additions and 1 deletions

View File

@ -32,9 +32,12 @@ class ExtensibleSet extends FormElement
protected function _filterValue(&$value, &$key) protected function _filterValue(&$value, &$key)
{ {
if ($value !== null) { if (is_array($value)) {
$value = array_filter($value, 'strlen'); $value = array_filter($value, 'strlen');
} elseif (is_string($value) && !strlen($value)) {
$value = null;
} }
return parent::_filterValue($value, $key); return parent::_filterValue($value, $key);
} }