From: Alexander Ebert Date: Tue, 13 Apr 2021 12:12:54 +0000 (+0200) Subject: Avoid one disk write with every request X-Git-Tag: 5.3.6~8 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=be81c8401ba16bd1f84fe95f8ca71c372cf548ec;p=GitHub%2FWoltLab%2FWCF.git Avoid one disk write with every request --- 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; }