Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
2d93b3a5
Commit
2d93b3a5
authored
Nov 15, 2006
by
Nigel McNie
Committed by
Nigel McNie
Nov 15, 2006
Browse files
Made this rule work when only one value is submitted - as is when radio
options are submitted.
parent
e6694a4b
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/form/rules/validateoptions.php
View file @
2d93b3a5
...
...
@@ -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
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment