X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;ds=sidebyside;f=load.php;h=6e829713a84c68356cdf4add54150e2cde252caf;hb=04f3cf05c89cd10809dc0d49742ab86e1d7e61b9;hp=7fff7c49916a77ef3d9d0af739e7d86356efa6ab;hpb=6fec4e3fdee76a551d7d50b95f05dd35f2128494;p=lhc%2Fweb%2Fwiklou.git diff --git a/load.php b/load.php index 7fff7c4991..6e829713a8 100644 --- a/load.php +++ b/load.php @@ -23,34 +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' ); } -// 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." ); +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; }