From: Ori Livneh Date: Wed, 28 Jan 2015 04:38:57 +0000 (-0800) Subject: Use PHP_OS rather than php_uname, which may be disabled X-Git-Tag: 1.31.0-rc.0~11619^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=e0e6c9c74684d5e63fe172d15c8f79ca9cca998e;p=lhc%2Fweb%2Fwiklou.git Use PHP_OS rather than php_uname, which may be disabled A user just logged on to the #mediawiki channel to ask for help because his webhost disallowed php_uname(), causing wfIsWindows() to crash. Google autocompletes 'php_uname()' to 'php_uname() has been disabled for security reasons', so it is probably not uncommon. Consulting the PHP_OS constant instead side-steps the problem nicely. Change-Id: I8d63826db4fc5d142eac53717d4f9fbbf9928de9 --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 3be43b39cc..31bb0999e3 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -2459,7 +2459,7 @@ function wfTimestampNow() { function wfIsWindows() { static $isWindows = null; if ( $isWindows === null ) { - $isWindows = substr( php_uname(), 0, 7 ) == 'Windows'; + $isWindows = strtoupper( substr( PHP_OS, 0, 3 ) ) === 'WIN'; } return $isWindows; }