Commit 2d93b3a5 authored by Nigel McNie's avatar Nigel McNie Committed by Nigel McNie
Browse files

Made this rule work when only one value is submitted - as is when radio

options are submitted.
parent e6694a4b
......@@ -37,7 +37,12 @@ defined('INTERNAL') || die();
* @todo untested :p
function form_rule_validateoptions($field, $element) {
$field = (array) $field;
// Get the value into an array as a key if it's a scalar, since
// the actual check involves array keys
if (!is_array($field)) {
$field = array($field => '');
$allowedvalues = array_keys($element['options']);
foreach (array_keys($field) as $key) {
if (!in_array($key, $allowedvalues)) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment