summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2008-10-25 06:46:55 +0000
committerScott Ullrich <sullrich@pfsense.org>2008-10-25 06:46:55 +0000
commit349ef5c973c6cc7bd6e98f52795637b45806e087 (patch)
treec6075d77f6a7443442c5b0babef5f53f5b264b3e
parent41fd0445840bdd37d7be019eab800bfc331ef812 (diff)
downloadpfsense-349ef5c973c6cc7bd6e98f52795637b45806e087.zip
pfsense-349ef5c973c6cc7bd6e98f52795637b45806e087.tar.gz
Do not attempt to save blank fieldname values
-rwxr-xr-xusr/local/www/pkg_edit.php9
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;
}
}
OpenPOWER on IntegriCloud