Correctly handle a missing .htaccess in the tmp/ folder
authorTim Düsterhus <duesterhus@woltlab.com>
Tue, 13 Apr 2021 14:59:42 +0000 (16:59 +0200)
committerGitHub <noreply@github.com>
Tue, 13 Apr 2021 14:59:42 +0000 (16:59 +0200)
see be81c8401ba16bd1f84fe95f8ca71c372cf548ec

wcfsetup/install/files/lib/util/FileUtil.class.php

index 405f1c6d2bac3f878536bd8dcac921671fa0fd4f..d0b83a326aae185e95c2e71dd724ec16f210af43 100644 (file)
@@ -39,8 +39,6 @@ final class FileUtil {
         */
        public static function getTempFolder() {
                try {
-                       // This method does not contain any shut up operator by intent.
-                       // Any operation that fails here is fatal.
                        $path = WCF_DIR.'tmp/';
                        
                        if (is_file($path)) {
@@ -64,7 +62,7 @@ final class FileUtil {
                                throw new SystemException("Temporary folder '".$path."' is not writable. Please check the permissions using your favorite ftp program.");
                        }
 
-                       if (md5_file($path . '/.htaccess') !== '5cc8a02be988615b049f5abecba2f3a0') {
+                       if (@md5_file($path . '/.htaccess') !== '5cc8a02be988615b049f5abecba2f3a0') {
                                file_put_contents($path.'/.htaccess', 'deny from all');
                        }