Browse Source

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

Évite le téléchargement
Alexandre Alapetite 12 năm trước cách đây
mục cha
commit
8beb15460a
3 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 1 1
      app/Models/Configuration.php
  2. 1 1
      data/.gitignore
  3. 1 1
      lib/Minz/Configuration.php

+ 1 - 1
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);
 		}

+ 1 - 1
data/.gitignore

@@ -4,4 +4,4 @@ config.php
 *.sqlite
 touch.txt
 no-cache.txt
-*.bak
+*.bak.php

+ 1 - 1
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