Sauvegardes avec extension .bak.php pour plus de sécurité

Évite le téléchargement
This commit is contained in:
Alexandre Alapetite committed 2014-01-01 05:06:36 +01:00
1 parent bc4116ea77
commit 8beb15460a
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -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);
}
+1 -1
View File
@@ -4,4 +4,4 @@ config.php
*.sqlite
touch.txt
no-cache.txt
*.bak
*.bak.php
+1 -1
View File
@@ -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