global $wgAllMessagesEn;
if ( $this->mDisable ) {
- wfDebug( "MessageCache::load(): disabled\n" );
+ static $shownDisabled = false;
+ if ( !$shownDisabled ) {
+ wfDebug( "MessageCache::load(): disabled\n" );
+ $shownDisabled = true;
+ }
return true;
}
$fname = 'MessageCache::load';
}
/**
- * Obsolete
+ * @deprecated
*/
function isCacheable( $key ) {
return true;
}
# If uninitialised, someone is trying to call this halfway through Setup.php
if( !$this->mInitialised ) {
- return "<$key>";
+ return '<' . htmlspecialchars($key) . '>';
}
# If cache initialization was deferred, start it now.
if( $this->mDeferred ) {
# Final fallback
if( !$message ) {
- $message = "<$key>";
+ return '<' . htmlspecialchars($key) . '>';
}
# Replace brace tags
function disableTransform() { $this->mDisableTransform = true; }
function enableTransform() { $this->mDisableTransform = false; }
+ /**
+ * Add a message to the cache
+ *
+ * @param mixed $key
+ * @param mixed $value
+ */
function addMessage( $key, $value ) {
$this->mExtensionMessages[$key] = $value;
}
+ /**
+ * Add an associative array of message to the cache
+ *
+ * @param array $messages An associative array of key => values to be added
+ */
function addMessages( $messages ) {
foreach ( $messages as $key => $value ) {
$this->mExtensionMessages[$key] = $value;