Avoid one disk write with every request
authorAlexander Ebert <ebert@woltlab.com>
Tue, 13 Apr 2021 12:12:54 +0000 (14:12 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 13 Apr 2021 12:12:54 +0000 (14:12 +0200)
wcfsetup/install/files/lib/util/FileUtil.class.php

index cbb148e0a0026b5ffdb41cd95dbfb61e9c739449..405f1c6d2bac3f878536bd8dcac921671fa0fd4f 100644 (file)
@@ -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;
                }