New installer: fixed fatal exception due to attempted DB access from User::loadOptions()
authorMax Semenik <maxsem@users.mediawiki.org>
Sat, 3 Jul 2010 06:06:02 +0000 (06:06 +0000)
committerMax Semenik <maxsem@users.mediawiki.org>
Sat, 3 Jul 2010 06:06:02 +0000 (06:06 +0000)
includes/installer/Installer.php

index 0380442..6af820b 100644 (file)
@@ -224,6 +224,10 @@ abstract class Installer {
                $wgExtensionMessagesFiles['MediawikiInstaller'] =
                        './includes/installer/Installer.i18n.php';
 
+               global $wgUser;
+               $wgUser = User::newFromId( 0 );
+               // Having a user with id = 0 safeguards us from DB access via User::loadOptions()
+
                // Set our custom <doclink> hook
                global $wgHooks;
                $wgHooks['ParserFirstCallInit'][] = array( $this, 'registerDocLink' );