X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=load.php;h=6e829713a84c68356cdf4add54150e2cde252caf;hb=4ab31fc35b48f6115fd391743f10a69b129e812c;hp=ff6d9d7fef15266cfd1be40f52c669eeb2c98900;hpb=7055add7990fd1fd23d4a58572582cf97839614d;p=lhc%2Fweb%2Fwiklou.git diff --git a/load.php b/load.php index ff6d9d7fef..6e829713a8 100644 --- a/load.php +++ b/load.php @@ -23,38 +23,22 @@ * */ -// We want error messages to not be interpreted as CSS or JS -function wfDie( $msg = '' ) { - header( $_SERVER['SERVER_PROTOCOL'] . ' 500 MediaWiki configuration Error', true, 500 ); - echo "/* $msg */"; - die( 1 ); +// Bail if PHP is too low +if ( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.2.3' ) < 0 ) { + require( dirname( __FILE__ ) . '/includes/PHPVersionError.php' ); + wfPHPVersionError( 'load.php' ); } -// Load global constants, including MW_VERSION and MW_MIN_PHP_VERSION -require_once( dirname( __FILE__ ) . '/includes/Defines.php' ); - -// Die on unsupported PHP versions -if( !function_exists( 'version_compare' ) || version_compare( phpversion(), MW_MIN_PHP_VERSION ) < 0 ){ - $version = htmlspecialchars( MW_VERSION ); - $phpversion = htmlspecialchars( MW_MIN_PHP_VERSION ); - wfDie( "MediaWiki $version requires at least PHP version $phpversion." ); +if ( isset( $_SERVER['MW_COMPILED'] ) ) { + require ( 'phase3/includes/WebStart.php' ); +} else { + require ( dirname( __FILE__ ) . '/includes/WebStart.php' ); } -require ( dirname( __FILE__ ) . '/includes/WebStart.php' ); wfProfileIn( 'load.php' ); // URL safety checks -// -// See RawPage.php for details; summary is that MSIE can override the -// Content-Type if it sees a recognized extension on the URL, such as -// might be appended via PATH_INFO after 'load.php'. -// -// Some resources can contain HTML-like strings (e.g. in messages) -// which will end up triggering HTML detection and execution. -// -if ( $wgRequest->isPathInfoBad() ) { - wfHttpError( 403, 'Forbidden', - 'Invalid file extension found in PATH_INFO or QUERY_STRING.' ); +if ( !$wgRequest->checkUrlExtension() ) { return; }