r86311 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86310‎ | r86311 | r86312 >
Date:13:53, 18 April 2011
Author:reedy
Status:ok
Tags:
Comment:
Followup r86304

Things won't just happily accept a ParserOutput object when they were getting strings before

Add missing calling parameter
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/Message.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -719,7 +719,7 @@
720720 $args = func_get_args();
721721 array_shift( $args );
722722 return wfMsgReplaceArgs(
723 - MessageCache::singleton()->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 )->getText(),
724724 $args );
725725 }
726726
@@ -742,8 +742,6 @@
743743 * Behavior for conflicting options (e.g., parse+parseinline) is undefined.
744744 */
745745 function wfMsgExt( $key, $options ) {
746 - global $wgMessageCache;
747 -
748746 $args = func_get_args();
749747 array_shift( $args );
750748 array_shift( $args );
@@ -783,9 +781,9 @@
784782
785783 $messageCache = MessageCache::singleton();
786784 if( in_array( 'parse', $options, true ) ) {
787 - $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj );
 785+ $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj )->getText();
788786 } elseif ( in_array( 'parseinline', $options, true ) ) {
789 - $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj );
 787+ $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj )->getText();
790788 $m = array();
791789 if( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) {
792790 $string = $m[1];
Index: trunk/phase3/includes/Message.php
@@ -432,7 +432,7 @@
433433 * @return string Wikitext parsed into HTML
434434 */
435435 protected function parseText( $string ) {
436 - return MessageCache::singleton()->parse( $string, /*linestart*/true, $this->interface, $this->language );
 436+ return MessageCache::singleton()->parse( $string, null, /*linestart*/true, $this->interface, $this->language )->getText();
437437 }
438438
439439 /**

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