From 31f4f5df600bf55ba6138f229b981e967f2b19d6 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 15 Mar 2015 19:21:16 +0100 Subject: [PATCH] small fixes to backup config --- src/opnsense/mvc/app/library/OPNsense/Core/Config.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/opnsense/mvc/app/library/OPNsense/Core/Config.php b/src/opnsense/mvc/app/library/OPNsense/Core/Config.php index 23d728e35..a0935f8f5 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Core/Config.php +++ b/src/opnsense/mvc/app/library/OPNsense/Core/Config.php @@ -364,7 +364,7 @@ class Config extends Singleton public function restoreBackup($filename) { - if ($this->statusIsValid) { + if ($this->isValid()) { // if current config is valid, $simplexml = $this->simplexml; try { @@ -377,6 +377,7 @@ class Config extends Singleton $this->simplexml = $simplexml; $this->statusIsValid = true; $this->save(null, true); + return false; } } else { // we don't have a valid config loaded, just copy and load the requested one