X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=load.php;h=6e829713a84c68356cdf4add54150e2cde252caf;hb=8a42c19f417a886b6f7f3c0f63b10d6996f88553;hp=2fc48fc95079ad6a4ea398e4fbc5f87425af292b;hpb=ff1dc8a17591c1e540d6f7e2ccb5c1ba0dec2e34;p=lhc%2Fweb%2Fwiklou.git diff --git a/load.php b/load.php index 2fc48fc950..6e829713a8 100644 --- a/load.php +++ b/load.php @@ -23,17 +23,10 @@ * */ -// 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 ); -} - -// Die on unsupported PHP versions -if( !function_exists( 'version_compare' ) || version_compare( phpversion(), '5.2.3' ) < 0 ){ - $version = htmlspecialchars( $wgVersion ); - wfDie( "MediaWiki $version requires at least PHP version 5.2.3." ); +// 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' ); } if ( isset( $_SERVER['MW_COMPILED'] ) ) { @@ -45,17 +38,7 @@ if ( isset( $_SERVER['MW_COMPILED'] ) ) { 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; }