ugh, missed this global var
[lhc/web/wiklou.git] / load.php
index 89aec98..6e82971 100644 (file)
--- a/load.php
+++ b/load.php
  *
  */
 
-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 or QUERY_STRING.' );
+if ( !$wgRequest->checkUrlExtension() ) {
        return;
 }
 
@@ -48,5 +49,7 @@ $resourceLoader->respond( new ResourceLoaderContext( $resourceLoader, $wgRequest
 wfProfileOut( 'load.php' );
 wfLogProfilingData();
 
-// Shut down the database
-wfGetLBFactory()->shutdown();
+// 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();