r55080 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55079‎ | r55080 | r55081 >
Date:03:49, 15 August 2009
Author:tstarling
Status:ok
Tags:
Comment:
Fix SQL error when the database is in read-only mode. Don't attempt to invalidate the user cache.
Modified paths:
  • /trunk/extensions/CentralAuth/CentralAuthHooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/CentralAuthHooks.php
@@ -383,7 +383,9 @@
384384 wfSetupSession();
385385 if ($token != @$_SESSION['globalloggedin'] ) {
386386 $_SESSION['globalloggedin'] = $token;
387 - $user->invalidateCache();
 387+ if ( !wfReadOnly() ) {
 388+ $user->invalidateCache();
 389+ }
388390 wfDebug( __METHOD__.": Initialising session for $userName with token $token.\n" );
389391 } else {
390392 wfDebug( __METHOD__.": Session already initialised for $userName with token $token.\n" );

Status & tagging log