[Pieforms-commit] SF.net SVN: pieforms: [30] pieforms/src/pieform/rules/validateoptions.php
Status: Alpha
Brought to you by:
oracleshinoda
|
From: <ora...@us...> - 2006-11-18 12:52:12
|
Revision: 30
http://svn.sourceforge.net/pieforms/?rev=30&view=rev
Author: oracleshinoda
Date: 2006-11-18 04:52:08 -0800 (Sat, 18 Nov 2006)
Log Message:
-----------
Properly fix detection of invalid options, for standard selects, multiselects and radios
Modified Paths:
--------------
pieforms/src/pieform/rules/validateoptions.php
Modified: pieforms/src/pieform/rules/validateoptions.php
===================================================================
--- pieforms/src/pieform/rules/validateoptions.php 2006-11-18 12:39:26 UTC (rev 29)
+++ pieforms/src/pieform/rules/validateoptions.php 2006-11-18 12:52:08 UTC (rev 30)
@@ -37,12 +37,10 @@
function pieform_rule_validateoptions(Pieform $form, $field, $element) {
// 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 => '');
- }
+ $field = (array) $field;
$allowedvalues = array_keys($element['options']);
- foreach (array_keys($field) as $key) {
+ foreach ($field as $key) {
if (!in_array($key, $allowedvalues)) {
return sprintf($form->i18n('validateoptions'), $key);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|