r68941 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r68940‎ | r68941 | r68942 >
Date:06:06, 3 July 2010
Author:maxsem
Status:ok
Tags:
Comment:
New installer: fixed fatal exception due to attempted DB access from User::loadOptions()
Modified paths:
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.php
@@ -224,6 +224,10 @@
225225 $wgExtensionMessagesFiles['MediawikiInstaller'] =
226226 './includes/installer/Installer.i18n.php';
227227
 228+ global $wgUser;
 229+ $wgUser = User::newFromId( 0 );
 230+ // Having a user with id = 0 safeguards us from DB access via User::loadOptions()
 231+
228232 // Set our custom <doclink> hook
229233 global $wgHooks;
230234 $wgHooks['ParserFirstCallInit'][] = array( $this, 'registerDocLink' );

Status & tagging log