- // @todo move this logic to MessageCache
- if ( $this->exists() ) {
- // NOTE: use transclusion text for messages.
- // This is consistent with MessageCache::getMsgFromNamespace()
-
- $content = $this->getContent();
- $text = $content === null ? null : $content->getWikitextForTransclusion();
-
- if ( $text === null ) {
- $text = false;
- }
- } else {
- $text = false;
- }
-
- MessageCache::singleton()->replace( $this->mTitle->getDBkey(), $text );
+ $messageCache = MessageCache::singleton();
+ $messageCache->updateMessageOverride( $this->mTitle, $this->getContent() );