diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2008-10-25 06:46:55 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2008-10-25 06:46:55 +0000 |
commit | 349ef5c973c6cc7bd6e98f52795637b45806e087 (patch) | |
tree | c6075d77f6a7443442c5b0babef5f53f5b264b3e | |
parent | 41fd0445840bdd37d7be019eab800bfc331ef812 (diff) | |
download | pfsense-349ef5c973c6cc7bd6e98f52795637b45806e087.zip pfsense-349ef5c973c6cc7bd6e98f52795637b45806e087.tar.gz |
Do not attempt to save blank fieldname values
-rwxr-xr-x | usr/local/www/pkg_edit.php | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr/local/www/pkg_edit.php b/usr/local/www/pkg_edit.php index a88c25f..05b61cb 100755 --- a/usr/local/www/pkg_edit.php +++ b/usr/local/www/pkg_edit.php @@ -132,8 +132,10 @@ if ($_POST) { $reqfieldsn = array(); foreach ($pkg['fields']['field'] as $field) { if (($field['type'] == 'input') && isset($field['required'])) { - $reqfields[] = $field['fieldname']; - $reqfieldsn[] = $field['fielddescr']; + if($field['fieldname']) + $reqfields[] = $field['fieldname']; + if($field['fielddescr']) + $reqfieldsn[] = $field['fielddescr']; } } do_input_validation($_POST, $reqfields, $reqfieldsn, &$input_errors); @@ -176,7 +178,8 @@ if ($_POST) { if ($fields['encoding'] == 'base64') $fieldvalue = base64_encode($fieldvalue); } - $pkgarr[$fieldname] = $fieldvalue; + if($fieldname) + $pkgarr[$fieldname] = $fieldvalue; } } |