check to ensure $values is not null or empty before exploding. Otherwise, return an empty array

This commit is contained in:
Stewart Wilson 2015-06-05 14:36:46 +10:00 committed by Stewart Wilson
parent d3b7abb0b5
commit 9421374f91

View File

@ -96,8 +96,12 @@ class CheckboxSetField extends OptionsetField {
}
}
} elseif($values && is_string($values)) {
$items = explode(',', $values);
$items = str_replace('{comma}', ',', $items);
if(!empty($values)) {
$items = explode(',', $values);
$items = str_replace('{comma}', ',', $items);
} else {
$items = array();
}
}
}
} else {
@ -109,8 +113,12 @@ class CheckboxSetField extends OptionsetField {
$items = array();
}
else {
$items = explode(',', $values);
$items = str_replace('{comma}', ',', $items);
if(!empty($values)) {
$items = explode(',', $values);
$items = str_replace('{comma}', ',', $items);
} else {
$items = array();
}
}
}
}