From fc60d04cd6c7999545e7a70a63c93bbca81d8c1b Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Tue, 10 Mar 2020 10:47:14 +0100 Subject: [PATCH] MVC, config: fix getBackupFilename(), floats aren't really safe to use of we only want to split the number part. --- src/opnsense/mvc/app/library/OPNsense/Core/Config.php | 2 +- 1 file changed, 1 insertion(+), 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 1a8ef5a18..422a1f7ce 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Core/Config.php +++ b/src/opnsense/mvc/app/library/OPNsense/Core/Config.php @@ -566,7 +566,7 @@ class Config extends Singleton */ public function getBackupFilename($revision) { - $tmp = (float)$revision; + $tmp = preg_replace("/[^0-9.]/", $revision); $bckfilename = dirname($this->config_file) . "/backup/config-{$tmp}.xml"; if (is_file($bckfilename)) { return $bckfilename;