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
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;
}