From: Alexander Ebert Date: Wed, 18 Dec 2013 15:56:34 +0000 (+0100) Subject: Using PHP_EOL instead of php_uname() to determine version X-Git-Tag: 2.0.1~38 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0436b61813619263c7bc32bee30b40c3cd859cc1;p=GitHub%2FWoltLab%2FWCF.git Using PHP_EOL instead of php_uname() to determine version --- diff --git a/wcfsetup/install.php b/wcfsetup/install.php index 612765b04d..96fa599263 100644 --- a/wcfsetup/install.php +++ b/wcfsetup/install.php @@ -308,10 +308,13 @@ class BasicFileUtil { // determine mode if (self::$mode === null) { // do not use PHP_OS here, as this represents the system it was built on != running on - if (strpos(php_uname(), 'Windows') !== false) { + // php_uname() is forbidden on some strange hosts; PHP_EOL is reliable + if (PHP_EOL == "\r\n") { + // Windows self::$mode = 0777; } else { + // anything but Windows clearstatcache(); self::$mode = 0666; diff --git a/wcfsetup/install/files/lib/util/FileUtil.class.php b/wcfsetup/install/files/lib/util/FileUtil.class.php index 5fc07f5d8d..2c7caccea7 100644 --- a/wcfsetup/install/files/lib/util/FileUtil.class.php +++ b/wcfsetup/install/files/lib/util/FileUtil.class.php @@ -505,10 +505,13 @@ final class FileUtil { // WCFSetup if (defined('INSTALL_SCRIPT')) { // do not use PHP_OS here, as this represents the system it was built on != running on - if (strpos(php_uname(), 'Windows') !== false) { - self::$mode = '0777'; + // php_uname() is forbidden on some strange hosts; PHP_EOL is reliable + if (PHP_EOL == "\r\n") { + // Windows + self::$mode = 0777; } else { + // anything but Windows clearstatcache(); self::$mode = '0666';