summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorDarren Embry <dse@webonastick.com>2012-05-17 17:32:04 -0400
committerDarren Embry <dse@webonastick.com>2012-05-17 17:32:04 -0400
commit8dcca9b51bf413509adfd8c36ec3c05b1e1b4ea9 (patch)
tree01e18a2c6fa76b73bef2bdb1906b897f62b8b52d /usr
parent428c289fb4c69a08f6ff1babc049b64c7398daf4 (diff)
downloadpfsense-8dcca9b51bf413509adfd8c36ec3c05b1e1b4ea9.zip
pfsense-8dcca9b51bf413509adfd8c36ec3c05b1e1b4ea9.tar.gz
- also rename $section arg to $section_name in some functions to clarify
- also robustify parsing for <tagname> and bulletproof the handling of certain errors
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/diag_backup.php27
1 files changed, 15 insertions, 12 deletions
diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php
index 09f599b..a413ccf 100755
--- a/usr/local/www/diag_backup.php
+++ b/usr/local/www/diag_backup.php
@@ -373,21 +373,24 @@ if ($_POST) {
}
if($_POST['restorearea']) {
/* restore a specific area of the configuration */
- if(!stristr($data, $_POST['restorearea'])) {
+ if(!stristr($data, "<" . $_POST['restorearea'] . ">")) {
$input_errors[] = gettext("You have selected to restore an area but we could not locate the correct xml tag.");
} else {
- restore_config_section($_POST['restorearea'], $data);
- if ($config['rrddata']) {
- restore_rrddata();
- unset($config['rrddata']);
- unlink_if_exists("{$g['tmp_path']}/config.cache");
- write_config();
- add_base_packages_menu_items();
- convert_config();
- conf_mount_ro();
+ if (!restore_config_section($_POST['restorearea'], $data)) {
+ $input_errors[] = gettext("You have selected to restore an area but we could not locate the correct xml tag.");
+ } else {
+ if ($config['rrddata']) {
+ restore_rrddata();
+ unset($config['rrddata']);
+ unlink_if_exists("{$g['tmp_path']}/config.cache");
+ write_config();
+ add_base_packages_menu_items();
+ convert_config();
+ conf_mount_ro();
+ }
+ filter_configure();
+ $savemsg = gettext("The configuration area has been restored. You may need to reboot the firewall.");
}
- filter_configure();
- $savemsg = gettext("The configuration area has been restored. You may need to reboot the firewall.");
}
} else {
if(!stristr($data, "<" . $g['xml_rootobj'] . ">")) {
OpenPOWER on IntegriCloud