summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-01 05:06:36 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2014-01-01 05:06:36 +0100
commit8beb15460a3c55c37264fdf414e7dcf9ff4e2a62 (patch)
tree56cabda8f4243edf55065dd00e378bc6ee086278
parentbc4116ea77a927683b2abe8a7b4b4fde6452f7d6 (diff)
Sauvegardes avec extension .bak.php pour plus de sécurité
Évite le téléchargement
-rw-r--r--app/Models/Configuration.php2
-rw-r--r--data/.gitignore2
-rw-r--r--lib/Minz/Configuration.php2
3 files changed, 3 insertions, 3 deletions
diff --git a/app/Models/Configuration.php b/app/Models/Configuration.php
index a39d47888..e0ae3bf6b 100644
--- a/app/Models/Configuration.php
+++ b/app/Models/Configuration.php
@@ -79,7 +79,7 @@ class FreshRSS_Configuration {
}
public function save() {
- @rename($this->filename, $this->filename . '.bak');
+ @rename($this->filename, $this->filename . '.bak.php');
if (file_put_contents($this->filename, "<?php\n return " . var_export($this->data, true) . ';', LOCK_EX) === false) {
throw new Minz_PermissionDeniedException($this->filename);
}
diff --git a/data/.gitignore b/data/.gitignore
index 1d8393f3b..005982b00 100644
--- a/data/.gitignore
+++ b/data/.gitignore
@@ -4,4 +4,4 @@ config.php
*.sqlite
touch.txt
no-cache.txt
-*.bak
+*.bak.php
diff --git a/lib/Minz/Configuration.php b/lib/Minz/Configuration.php
index fc94d9731..2c30661ed 100644
--- a/lib/Minz/Configuration.php
+++ b/lib/Minz/Configuration.php
@@ -156,7 +156,7 @@ class Minz_Configuration {
),
'db' => self::$db,
);
- @rename(DATA_PATH . self::CONF_PATH_NAME, DATA_PATH . self::CONF_PATH_NAME . '.bak');
+ @rename(DATA_PATH . self::CONF_PATH_NAME, DATA_PATH . self::CONF_PATH_NAME . '.bak.php');
$result = file_put_contents(DATA_PATH . self::CONF_PATH_NAME, "<?php\n return " . var_export($ini_array, true) . ';');
if (function_exists('opcache_invalidate')) {
opcache_invalidate(DATA_PATH . self::CONF_PATH_NAME); //Clear PHP 5.5+ cache for include