From 43dbe1cebf71a2b981dc439b7f17727512fcd63a Mon Sep 17 00:00:00 2001
From: Lukas Reschke <lukas@owncloud.com>
Date: Mon, 11 Jan 2016 15:37:08 +0100
Subject: [PATCH] Revert "Remove unneeded check if htaccess test file already
 exists"

---
 lib/private/util.php | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/lib/private/util.php b/lib/private/util.php
index ed62f1afb4a..4bcde68c355 100644
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -1201,6 +1201,10 @@ class OC_Util {
 		// creating a test file
 		$testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName;
 
+		if (file_exists($testFile)) {// already running this test, possible recursive call
+			return false;
+		}
+
 		$fp = @fopen($testFile, 'w');
 		if (!$fp) {
 			throw new OC\HintException('Can\'t create test file to check for working .htaccess file.',
-- 
GitLab