bugfix: use true/false for boolean values read from <select>s instead of 1/0

This commit is contained in:
Crack
2010-08-03 00:37:39 +02:00
parent 53e8d75c0f
commit e3f6715c44
2 changed files with 13 additions and 14 deletions

View File

@@ -461,8 +461,8 @@ class FormDisplay
*/
private function _validateSelect(&$value, array $allowed)
{
foreach ($allowed as $v) {
if ($value == $v) {
foreach ($allowed as $vk => $v) {
if ($value == $vk) {
settype($value, gettype($v));
return true;
}
@@ -556,7 +556,7 @@ class FormDisplay
}
break;
case 'select':
if (!$this->_validateSelect($_POST[$key], array_keys($form->getOptionValueList($system_path)))) {
if (!$this->_validateSelect($_POST[$key], $form->getOptionValueList($system_path))) {
$this->errors[$work_path][] = __('Incorrect value');
$result = false;
continue;