Skip to content

Commit

Permalink
check to ensure $values is not null or empty before exploding. Otherw…
Browse files Browse the repository at this point in the history
…ise, return an empty array
  • Loading branch information
Stewart Wilson authored and swilsonau committed Jun 5, 2015
1 parent d3b7abb commit 9421374
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions forms/CheckboxSetField.php
Expand Up @@ -96,8 +96,12 @@ public function getOptions() {
}
}
} 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 {
Expand All @@ -109,8 +113,12 @@ public function getOptions() {
$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();
}
}
}
}
Expand Down

0 comments on commit 9421374

Please sign in to comment.