Don't load user session in command line mode; this can bork web-based
authorBrion Vibber <brion@users.mediawiki.org>
Sun, 2 May 2004 09:06:56 +0000 (09:06 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Sun, 2 May 2004 09:06:56 +0000 (09:06 +0000)
reinstalls in some circumstances (bug 941461)

config/index.php
includes/Setup.php

index 1967246..e14766d 100644 (file)
@@ -168,6 +168,7 @@ class ConfigData {
 
 ?>
 
+<p><i>Please include all of the lines below when reporting installation problems.</i></p>
 
 <h2>Checking environment...</h2>
 <ul>
index 78dd88b..cb13872 100644 (file)
@@ -165,7 +165,13 @@ if( !$wgCommandLineMode && ( isset( $_COOKIE[ini_get("session.name")] ) || isset
 }
 
 $wgBlockCache = new BlockCache( true );
-$wgUser = User::loadFromSession();
+if( $wgCommandLineMode ) {
+       # Used for some maintenance scripts; user session cookies can screw things up
+       # when the database is in an in-between state.
+       $wgUser = new User();
+} else {
+       $wgUser = User::loadFromSession();
+}
 $wgDeferredUpdateList = array();
 $wgLinkCache = new LinkCache();
 $wgMagicWords = array();