r56816 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56815‎ | r56816 | r56817 >
Date:13:51, 23 September 2009
Author:catrope
Status:ok
Tags:
Comment:
(bug 20773) Disabling LocalisationUpdate breaks stuff. Added a check that verifies each dependency object is a CacheDependency before using it, and considers the cache expired otherwise.
Modified paths:
  • /trunk/phase3/includes/LocalisationCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/LocalisationCache.php
@@ -304,7 +304,11 @@
305305 return true;
306306 }
307307 foreach ( $deps as $dep ) {
308 - if ( $dep->isExpired() ) {
 308+ // Because we're unserializing stuff from cache, we
 309+ // could receive objects of classes that don't exist
 310+ // anymore (e.g. uninstalled extensions)
 311+ // When this happens, always expire the cache
 312+ if ( !$dep instanceof CacheDependency || $dep->isExpired() ) {
309313 wfDebug( __METHOD__."($code): cache for $code expired due to " .
310314 get_class( $dep ) . "\n" );
311315 return true;

Status & tagging log