From 3def7f81873fef84b781174ad12f7e264b4caae5 Mon Sep 17 00:00:00 2001
From: Lukas Reschke <lukas@statuscode.ch>
Date: Sun, 3 Feb 2013 23:03:06 +0100
Subject: [PATCH] Make fileblacklist configurable

---
 config/config.sample.php | 3 +++
 lib/files/filesystem.php | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/config/config.sample.php b/config/config.sample.php
index 5264e94820..163beaae2f 100644
--- a/config/config.sample.php
+++ b/config/config.sample.php
@@ -32,6 +32,9 @@ $CONFIG = array(
 /* Force use of HTTPS connection (true = use HTTPS) */
 "forcessl" => false,
 
+/* Blacklist a specific file and disallow the upload of files with this name - WARNING: USE THIS ONLY IF YOU KNOW WHAT YOU ARE DOING. */
+"blacklisted_files" => array('.htaccess'),
+
 /* The automatic hostname detection of ownCloud can fail in certain reverse proxy situations. This option allows to manually override the automatic detection. You can also add a port. For example "www.example.com:88" */
 "overwritehost" => "",
 
diff --git a/lib/files/filesystem.php b/lib/files/filesystem.php
index 262fde320a..47c09acf29 100644
--- a/lib/files/filesystem.php
+++ b/lib/files/filesystem.php
@@ -374,7 +374,7 @@ class Filesystem {
 	 * @param array $data from hook
 	 */
 	static public function isBlacklisted($data) {
-		$blacklist = array('.htaccess');
+		$blacklist = \OC_Config::getValue('blacklisted_files', array('.htaccess'));
 		if (isset($data['path'])) {
 			$path = $data['path'];
 		} else if (isset($data['newpath'])) {
-- 
GitLab