X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2FWebStart.php;h=f97dc6a94f184810369ad50408387354520d00d1;hb=540608c8ddc2f57f64e1241b14a560c577b0a4b1;hp=da4bc8792059b45d19c92c23018a81980d27cb41;hpb=2086cd118020f6388d7b6952ac2d9e2b55e6ef1f;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/WebStart.php b/includes/WebStart.php index da4bc87920..f97dc6a94f 100644 --- a/includes/WebStart.php +++ b/includes/WebStart.php @@ -34,12 +34,30 @@ if ( ini_get( 'register_globals' ) ) { . 'for help on how to disable it.' ); } +if ( function_exists( 'get_magic_quotes_gpc' ) && get_magic_quotes_gpc() ) { + die( 'MediaWiki does not function when magic quotes are enabled. ' + . 'Please see the PHP Manual ' + . 'for help on how to disable magic quotes.' ); +} + + # 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 ); +# Approximate $_SERVER['REQUEST_TIME_FLOAT'] for PHP<5.4 +if ( !isset( $_SERVER['REQUEST_TIME_FLOAT'] ) ) { + $_SERVER['REQUEST_TIME_FLOAT'] = microtime( true ); +} + +/** + * @var float Request start time as fractional seconds since epoch + * @deprecated since 1.25; use $_SERVER['REQUEST_TIME_FLOAT'] or + * WebRequest::getElapsedTime() instead. + */ +$wgRequestTime = $_SERVER['REQUEST_TIME_FLOAT']; + unset( $IP ); # Valid web server entry point, enable includes. @@ -60,7 +78,6 @@ if ( $IP === false ) { # Grab profiling functions require_once "$IP/includes/profiler/ProfilerFunctions.php"; -$wgRUstart = wfGetRusage() ?: array(); # Start the autoloader, so that extensions can derive classes from core files require_once "$IP/includes/AutoLoader.php";