From be81c8401ba16bd1f84fe95f8ca71c372cf548ec Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Tue, 13 Apr 2021 14:12:54 +0200 Subject: [PATCH] Avoid one disk write with every request --- wcfsetup/install/files/lib/util/FileUtil.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/util/FileUtil.class.php b/wcfsetup/install/files/lib/util/FileUtil.class.php index cbb148e0a0..405f1c6d2b 100644 --- a/wcfsetup/install/files/lib/util/FileUtil.class.php +++ b/wcfsetup/install/files/lib/util/FileUtil.class.php @@ -63,8 +63,10 @@ final class FileUtil { if (!is_writable($path)) { throw new SystemException("Temporary folder '".$path."' is not writable. Please check the permissions using your favorite ftp program."); } - - file_put_contents($path.'/.htaccess', 'deny from all'); + + if (md5_file($path . '/.htaccess') !== '5cc8a02be988615b049f5abecba2f3a0') { + file_put_contents($path.'/.htaccess', 'deny from all'); + } return $path; } -- 2.20.1