r3466 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r3465‎ | r3466 | r3467 >
Date:10:21, 3 May 2004
Author:gabrielwicke
Status:old
Tags:
Comment:
added way to swich off message expansion
Modified paths:
  • /trunk/phase3/includes/MessageCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/MessageCache.php
@@ -18,6 +18,7 @@
1919 $this->mUseCache = $useMemCached;
2020 $this->mDisable = !$useDB;
2121 $this->mExpiry = $expiry;
 22+ $this->mDisableTransform = false;
2223 $this->mMemcKey = "$memcPrefix:messages";
2324 $this->mKeys = false; # initialised on demand
2425 $this->mInitialised = true;
@@ -197,19 +198,21 @@
198199
199200 # Replace brace tags
200201 $message = $this->transform( $message );
201 -
202202 return $message;
203203 }
204204
205205 function transform( $message ) {
206 - if ( strstr( $message, "{{" ) !== false ) {
207 - $message = $this->mParser->transformMsg( $message, $this->mParserOptions );
 206+ if( !$this->mDisableTransform ) {
 207+ if ( strstr( $message, "{{" ) !== false ) {
 208+ $message = $this->mParser->transformMsg( $message, $this->mParserOptions );
 209+ }
208210 }
209211 return $message;
210212 }
211213
212214 function disable() { $this->mDisable = true; }
213215 function enable() { $this->mDisable = false; }
 216+ function disableTransform() { $this->mDisableTransform = true; }
214217
215218 }
216219 ?>

Status & tagging log