ExtensibleSet: silently ignore null or empty strings

This commit is contained in:
Thomas Gelf 2016-03-05 17:25:23 +01:00
parent 3134630f86
commit c4d69e1a88
1 changed files with 5 additions and 0 deletions

View File

@ -472,6 +472,11 @@ class ExtensibleSet
protected function addValuesTo(&$array, $values)
{
foreach ($this->wantArray($values) as $value) {
// silently ignore null or empty strings
if (strlen($value) === 0) {
continue;
}
$this->addTo($array, $value);
}