From e6283c8499327c906a3278d29b1cd403ae25d6e1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tim=20D=C3=BCsterhus?= Date: Tue, 13 Apr 2021 16:59:42 +0200 Subject: [PATCH] Correctly handle a missing .htaccess in the tmp/ folder see be81c8401ba16bd1f84fe95f8ca71c372cf548ec --- wcfsetup/install/files/lib/util/FileUtil.class.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/wcfsetup/install/files/lib/util/FileUtil.class.php b/wcfsetup/install/files/lib/util/FileUtil.class.php index 405f1c6d2b..d0b83a326a 100644 --- a/wcfsetup/install/files/lib/util/FileUtil.class.php +++ b/wcfsetup/install/files/lib/util/FileUtil.class.php @@ -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'); } -- 2.20.1