From 7c7909f108dfcec5144563aa3c25fb06337348a4 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Wed, 23 Sep 2009 13:51:47 +0000 Subject: [PATCH] (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. --- includes/LocalisationCache.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/LocalisationCache.php b/includes/LocalisationCache.php index ae9007fb37..81f95aa417 100644 --- a/includes/LocalisationCache.php +++ b/includes/LocalisationCache.php @@ -304,7 +304,11 @@ class LocalisationCache { return true; } foreach ( $deps as $dep ) { - if ( $dep->isExpired() ) { + // Because we're unserializing stuff from cache, we + // could receive objects of classes that don't exist + // anymore (e.g. uninstalled extensions) + // When this happens, always expire the cache + if ( !$dep instanceof CacheDependency || $dep->isExpired() ) { wfDebug( __METHOD__."($code): cache for $code expired due to " . get_class( $dep ) . "\n" ); return true; -- 2.20.1