r86306 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86305‎ | r86306 | r86307 >
Date:12:59, 18 April 2011
Author:reedy
Status:ok
Tags:
Comment:
Replace $wgMessageCache with MessageCache::singleton()

Fix some tab/space issues

Follows up r86304
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/MessageCache.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -716,11 +716,10 @@
717717 * @return string
718718 */
719719 function wfMsgWikiHtml( $key ) {
720 - global $wgMessageCache;
721720 $args = func_get_args();
722721 array_shift( $args );
723722 return wfMsgReplaceArgs(
724 - $wgMessageCache->parse( wfMsgGetKey( $key, true ), null, /* can't be set to false */ true ),
 723+ MessageCache::singleton()->parse( wfMsgGetKey( $key, true ), null, /* can't be set to false */ true ),
725724 $args );
726725 }
727726
@@ -782,16 +781,17 @@
783782 $string = wfMsgReplaceArgs( $string, $args );
784783 }
785784
 785+ $messageCache = MessageCache::singleton();
786786 if( in_array( 'parse', $options, true ) ) {
787 - $string = $wgMessageCache->parse( $string, null, true, !$forContent, $langCodeObj );
 787+ $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj );
788788 } elseif ( in_array( 'parseinline', $options, true ) ) {
789 - $string = $wgMessageCache->parse( $string, null, true, !$forContent, $langCodeObj );
 789+ $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj );
790790 $m = array();
791791 if( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
792792 $string = $m[1];
793793 }
794794 } elseif ( in_array( 'parsemag', $options, true ) ) {
795 - $string = MessageCache::singleton()->transform( $string,
 795+ $string = $messageCache->transform( $string,
796796 !$forContent, $langCodeObj );
797797 }
798798
Index: trunk/phase3/includes/MessageCache.php
@@ -751,7 +751,7 @@
752752 }
753753
754754 if ( $this->mInParser ) {
755 - return $message;
 755+ return $message;
756756 }
757757
758758 $parser = $this->getParser();
@@ -798,7 +798,7 @@
799799 */
800800 public function parse( $text, $title = null, $linestart = true, $interface = false, $language = null ) {
801801 if ( $this->mInParser ) {
802 - return htmlspecialchars( $text );
 802+ return htmlspecialchars( $text );
803803 }
804804
805805 $parser = $this->getParser();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r86304* (bug 28532) wfMsgExt() and wfMsgWikiHtml() use $wgOut->parse()...reedy12:43, 18 April 2011

Status & tagging log