diff options
author | Ermal Luçi <eri@pfsense.org> | 2010-03-10 10:00:44 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2010-03-10 10:00:44 +0000 |
commit | ba9e9bbfed4bfafbc980ae348e1fc365c8c4ee8d (patch) | |
tree | d6ac6e09fc90b17c40395e19ac802dba2f180824 /usr/local/www | |
parent | 1c38875e1e4ad52c3e10a5700f23ad2dcf6d398c (diff) | |
download | pfsense-ba9e9bbfed4bfafbc980ae348e1fc365c8c4ee8d.zip pfsense-ba9e9bbfed4bfafbc980ae348e1fc365c8c4ee8d.tar.gz |
Correctly set variable values during each iteration. Ticket #414. Spotted-by: irc(Efonne)
Diffstat (limited to 'usr/local/www')
-rwxr-xr-x | usr/local/www/wizard.php | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php index f50d469..88da606 100755 --- a/usr/local/www/wizard.php +++ b/usr/local/www/wizard.php @@ -88,15 +88,20 @@ if($pkg['step'][$stepid]['stepsubmitbeforesave']) { if ($_POST) { foreach ($pkg['step'][$stepid]['fields']['field'] as $field) { - if($field['bindstofield'] <> "" and $field['type'] <> "submit") { + if(!empty($field['bindstofield']) and $field['type'] <> "submit") { $fieldname = $field['name']; - $unset_fields = ""; $fieldname = ereg_replace(" ", "", $fieldname); $fieldname = strtolower($fieldname); // update field with posted values. - if($field['unsetfield'] <> "") $unset_fields = "yes"; - if($field['arraynum'] <> "") $arraynum = $field['arraynum']; - if($field['bindstofield']) + if($field['unsetfield'] <> "") + $unset_fields = "yes"; + else + $unset_fields = ""; + if($field['arraynum'] <> "") + $arraynum = $field['arraynum']; + else + $arraynum = ""; + if(!empty($field['bindstofield'])) update_config_field( $field['bindstofield'], $_POST[$fieldname], $unset_fields, $arraynum, $field['type']); } |