From 891fde08e981fd0019e25c201553fc445f3fc3ba Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Wed, 11 Feb 2009 16:08:36 +0000 Subject: [PATCH] (bug 17414) Added magic words as a cache dependency --- languages/Language.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/languages/Language.php b/languages/Language.php index 97ac27cb41..427e7a975a 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -2396,6 +2396,12 @@ class Language { $cache = compact( self::$mLocalisationKeys ); wfDebug( "Language::loadLocalisation(): got localisation for $code from source\n" ); } + + # Load magic word source file + global $IP; + $filename = "$IP/includes/MagicWord.php"; + $newDeps = array( $filename => filemtime( $filename ) ); + $deps = array_merge( $deps, $newDeps ); if ( !empty( $fallback ) ) { # Load the fallback localisation, with a circular reference guard @@ -2472,6 +2478,10 @@ class Language { self::loadLocalisation( $cache ); $cache = self::$mLocalisationCache[$cache]; } + // At least one language file and the MagicWord file needed + if( count($cache['deps']) < 2 ) { + return true; + } $expired = false; foreach ( $cache['deps'] as $file => $mtime ) { if ( !file_exists( $file ) || filemtime( $file ) > $mtime ) { -- 2.20.1