diff options
author | jim-p <jimp@pfsense.org> | 2010-06-17 12:16:25 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2010-06-17 12:16:25 -0400 |
commit | b4eb3a17379560b8d070ed2f3d2ef1e67f9f4ae5 (patch) | |
tree | b4e9cf4cab422f739d57e0db3588512194701d5e /usr/local | |
parent | 1fa00d6d70b9891c89c76edd6ff6be4bb8968b9e (diff) | |
download | pfsense-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')
-rwxr-xr-x | usr/local/www/wizard.php | 7 |
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; |