mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
check to ensure $values is not null or empty before exploding. Otherwise, return an empty array
This commit is contained in:
parent
d3b7abb0b5
commit
9421374f91
@ -96,8 +96,12 @@ class CheckboxSetField extends OptionsetField {
|
||||
}
|
||||
}
|
||||
} elseif($values && is_string($values)) {
|
||||
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 {
|
||||
if(!empty($values)) {
|
||||
$items = explode(',', $values);
|
||||
$items = str_replace('{comma}', ',', $items);
|
||||
} else {
|
||||
$items = array();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user