summaryrefslogtreecommitdiffstats
path: root/usr/local/www/wizard.php
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-06-17 12:16:25 -0400
committerjim-p <jimp@pfsense.org>2010-06-17 12:16:25 -0400
commitb4eb3a17379560b8d070ed2f3d2ef1e67f9f4ae5 (patch)
treeb4e9cf4cab422f739d57e0db3588512194701d5e /usr/local/www/wizard.php
parent1fa00d6d70b9891c89c76edd6ff6be4bb8968b9e (diff)
downloadpfsense-b4eb3a17379560b8d070ed2f3d2ef1e67f9f4ae5.zip
pfsense-b4eb3a17379560b8d070ed2f3d2ef1e67f9f4ae5.tar.gz
Check if a variable is set before trying to unset. Otherwise, this will blow up with $a[b][c] if $a[b] doesn't exist.
Diffstat (limited to 'usr/local/www/wizard.php')
-rwxr-xr-xusr/local/www/wizard.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr/local/www/wizard.php b/usr/local/www/wizard.php
index 8a5c78f..a59e83d 100755
--- a/usr/local/www/wizard.php
+++ b/usr/local/www/wizard.php
@@ -136,14 +136,15 @@ function update_config_field($field, $updatetext, $unset, $arraynum, $field_type
* item is a checkbox, it should have the value "on"
* if it was checked
*/
- $text = "unset(\$config" . $field_conv . ");";
+ $var = "\$config{$field_conv}";
+ $text = "if (isset({$var})) unset({$var});";
eval($text);
return;
}
if($field_type == "interfaces_selection") {
- $text = "unset(\$config" . $field_conv . ");";
- eval($text);
+ $var = "\$config{$field_conv}";
+ $text = "if (isset({$var})) unset({$var});";
$text = "\$config" . $field_conv . " = \"" . $updatetext . "\";";
eval($text);
return;
OpenPOWER on IntegriCloud