From 08aa4418c30cfc18ccc69a0f0f9cb9e17be6c196 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Mon, 12 Aug 2013 09:28:15 +0200 Subject: Update to MediaWiki 1.21.1 --- includes/WebStart.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'includes/WebStart.php') diff --git a/includes/WebStart.php b/includes/WebStart.php index 01c5eea8..e6f31355 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -27,7 +27,7 @@ # This must be done before any globals are set by the code if ( ini_get( 'register_globals' ) ) { if ( isset( $_REQUEST['GLOBALS'] ) || isset( $_FILES['GLOBALS'] ) ) { - die( '$GLOBALS overwrite vulnerability'); + die( '$GLOBALS overwrite vulnerability' ); } $verboten = array( 'GLOBALS', @@ -57,12 +57,12 @@ if ( ini_get( 'register_globals' ) ) { } } -# bug 15461: Make IE8 turn off content sniffing. Everbody else should ignore this +# bug 15461: Make IE8 turn off content sniffing. Everybody else should ignore this # We're adding it here so that it's *always* set, even for alternate entry # points and when $wgOut gets disabled or overridden. header( 'X-Content-Type-Options: nosniff' ); -$wgRequestTime = microtime(true); +$wgRequestTime = microtime( true ); # getrusage() does not exist on the Microsoft Windows platforms, catching this if ( function_exists ( 'getrusage' ) ) { $wgRUstart = getrusage(); @@ -80,11 +80,15 @@ define( 'MEDIAWIKI', true ); # Full path to working directory. # Makes it possible to for example to have effective exclude path in apc. -# Also doesn't break installations using symlinked includes, like -# __DIR__ would do. +# __DIR__ breaks symlinked includes, but realpath() returns false +# if we don't have permissions on parent directories. $IP = getenv( 'MW_INSTALL_PATH' ); if ( $IP === false ) { - $IP = realpath( '.' ); + if( realpath( '.' ) ) { + $IP = realpath( '.' ); + } else { + $IP = dirname( __DIR__ ); + } } if ( isset( $_SERVER['MW_COMPILED'] ) ) { @@ -119,7 +123,7 @@ if ( defined( 'MW_CONFIG_CALLBACK' ) ) { MWFunction::call( MW_CONFIG_CALLBACK ); } else { if ( !defined( 'MW_CONFIG_FILE' ) ) { - define('MW_CONFIG_FILE', MWInit::interpretedPath( 'LocalSettings.php' ) ); + define( 'MW_CONFIG_FILE', MWInit::interpretedPath( 'LocalSettings.php' ) ); } # LocalSettings.php is the per site customization file. If it does not exist @@ -156,4 +160,3 @@ wfProfileOut( 'WebStart.php-ob_start' ); if ( !defined( 'MW_NO_SETUP' ) ) { require_once( MWInit::compiledPath( "includes/Setup.php" ) ); } - -- cgit v1.2.2