From: Ævar Arnfjörð Bjarmason Date: Mon, 28 Nov 2005 14:50:56 +0000 (+0000) Subject: * Make sure not to crash when the message cache isn't alive X-Git-Tag: 1.6.0~1101 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=2f09ff388eb53308e5885c0b26d272cfad602eac;p=lhc%2Fweb%2Fwiklou.git * Make sure not to crash when the message cache isn't alive --- diff --git a/includes/GlobalFunctions.php b/includes/GlobalFunctions.php index 4a5e608122..57bd13281c 100644 --- a/includes/GlobalFunctions.php +++ b/includes/GlobalFunctions.php @@ -393,7 +393,8 @@ function wfMsgGetKey( $key, $useDB, $forContent = false, $transform = true ) { global $wgContLang, $wgLanguageCode; global $wgMessageCache, $wgLang; - $transstat = $wgMessageCache->getTransform(); + if ( is_object( $wgMessageCache ) ) + $transstat = $wgMessageCache->getTransform(); if( is_object( $wgMessageCache ) ) { if ( ! $transform ) @@ -421,7 +422,7 @@ function wfMsgGetKey( $key, $useDB, $forContent = false, $transform = true ) { } } - if ( ! $transform ) + if ( is_object( $wgMessageCache ) && ! $transform ) $wgMessageCache->setTransform( $transstat ); return $message;