X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=load.php;h=7fff7c49916a77ef3d9d0af739e7d86356efa6ab;hb=35c61744a640c795f4a163178e01da90df7d515d;hp=9affd3d037937b82d75afdc8302d058a571ca151;hpb=d9e6d84035e78ae37f2193f88302f4d4b8d73e97;p=lhc%2Fweb%2Fwiklou.git diff --git a/load.php b/load.php index 9affd3d037..7fff7c4991 100644 --- a/load.php +++ b/load.php @@ -22,7 +22,20 @@ * @author Trevor Parscal * */ - + +// 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." ); +} + require ( dirname( __FILE__ ) . '/includes/WebStart.php' ); wfProfileIn( 'load.php' ); @@ -37,18 +50,18 @@ wfProfileIn( 'load.php' ); // if ( $wgRequest->isPathInfoBad() ) { wfHttpError( 403, 'Forbidden', - 'Invalid file extension found in PATH_INFO. ' . - 'The resource loader must be accessed through the primary script entry point.' ); + 'Invalid file extension found in PATH_INFO or QUERY_STRING.' ); return; - // FIXME: Doesn't this execute the rest of the request anyway? - // Was taken from api.php so I guess it's maybe OK but it doesn't look good. } // Respond to resource loading request -ResourceLoader::respond( new ResourceLoaderContext( $wgRequest, $wgServer . $wgScriptPath . '/load.php' ) ); +$resourceLoader = new ResourceLoader(); +$resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, $wgRequest ) ); wfProfileOut( 'load.php' ); wfLogProfilingData(); -// Shut down the database -wfGetLBFactory()->shutdown(); \ No newline at end of file +// Shut down the database. foo()->bar() syntax is not supported in PHP4, and this file +// needs to *parse* in PHP4, although we'll never get down here to worry about = vs =& +$lb = wfGetLBFactory(); +$lb->shutdown();