summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-09-18 18:02:43 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-09-18 18:02:43 +0000
commit9fd18b1f147624a0d8f6287a3ecd4f5bfc4c98f3 (patch)
tree52277678e34804b4fd77f819346552ab9be5b65b /usr
parent208e9a9ce04c59544286fcb5a57d98137452d92e (diff)
downloadpfsense-9fd18b1f147624a0d8f6287a3ecd4f5bfc4c98f3.zip
pfsense-9fd18b1f147624a0d8f6287a3ecd4f5bfc4c98f3.tar.gz
Do not restore a configuration section if the tag is not found
Ticket #527
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/diag_backup.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/usr/local/www/diag_backup.php b/usr/local/www/diag_backup.php
index b6a4938..5d797ea 100755
--- a/usr/local/www/diag_backup.php
+++ b/usr/local/www/diag_backup.php
@@ -132,9 +132,13 @@ if ($_POST) {
if($_POST['restorearea'] <> "") {
/* restore a specific area of the configuration */
$rules = file_get_contents($_FILES['conffile']['tmp_name']);
- restore_config_section($_POST['restorearea'], $rules);
- filter_configure();
- $savemsg = "The configuration area has been restored.";
+ if(stristr($_POST['restorearea'], $rules) == false) {
+ $input_errors[] = "You have selected to restore a area but we could not locate the correct xml tag.";
+ } else {
+ restore_config_section($_POST['restorearea'], $rules);
+ filter_configure();
+ $savemsg = "The configuration area has been restored.";
+ }
} else {
/* restore the entire configuration */
if (config_install($_FILES['conffile']['tmp_name']) == 0) {
@@ -143,7 +147,6 @@ if ($_POST) {
touch("/needs_package_sync");
conf_mount_ro();
$reloadall = true;
-
$savemsg = "The configuration has been restored. The firewall is now reloading the settings.";
} else {
$input_errors[] = "The configuration could not be restored.";
OpenPOWER on IntegriCloud