X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=load.php;h=6e829713a84c68356cdf4add54150e2cde252caf;hb=d93ece35276f711f26d680df207155e62b7946ac;hp=9affd3d037937b82d75afdc8302d058a571ca151;hpb=d9e6d84035e78ae37f2193f88302f4d4b8d73e97;p=lhc%2Fweb%2Fwiklou.git diff --git a/load.php b/load.php index 9affd3d037..6e829713a8 100644 --- a/load.php +++ b/load.php @@ -22,33 +22,34 @@ * @author Trevor Parscal * */ - -require ( dirname( __FILE__ ) . '/includes/WebStart.php' ); + +// 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'] ) ) { + require ( 'phase3/includes/WebStart.php' ); +} else { + 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. ' . - 'The resource loader must be accessed through the primary script entry point.' ); +if ( !$wgRequest->checkUrlExtension() ) { 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();