Index: trunk/phase3/includes/GlobalFunctions.php |
— | — | @@ -719,7 +719,7 @@ |
720 | 720 | $args = func_get_args(); |
721 | 721 | array_shift( $args ); |
722 | 722 | return wfMsgReplaceArgs( |
723 | | - MessageCache::singleton()->parse( wfMsgGetKey( $key, true ), null, /* can't be set to false */ true )->getText(), |
| 723 | + MessageCache::singleton()->parse( wfMsgGetKey( $key, true ), $key, /* can't be set to false */ true )->getText(), |
724 | 724 | $args ); |
725 | 725 | } |
726 | 726 | |
— | — | @@ -781,9 +781,9 @@ |
782 | 782 | |
783 | 783 | $messageCache = MessageCache::singleton(); |
784 | 784 | if( in_array( 'parse', $options, true ) ) { |
785 | | - $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj )->getText(); |
| 785 | + $string = $messageCache->parse( $string, $key, true, !$forContent, $langCodeObj )->getText(); |
786 | 786 | } elseif ( in_array( 'parseinline', $options, true ) ) { |
787 | | - $string = $messageCache->parse( $string, null, true, !$forContent, $langCodeObj )->getText(); |
| 787 | + $string = $messageCache->parse( $string, $key, true, !$forContent, $langCodeObj )->getText(); |
788 | 788 | $m = array(); |
789 | 789 | if( preg_match( '/^<p>(.*)\n?<\/p>\n?$/sU', $string, $m ) ) { |
790 | 790 | $string = $m[1]; |
Index: trunk/phase3/includes/MessageCache.php |
— | — | @@ -790,13 +790,13 @@ |
791 | 791 | |
792 | 792 | /** |
793 | 793 | * @param $text string |
794 | | - * @param $title Title |
| 794 | + * @param $string Title|string |
795 | 795 | * @param $interface bool |
796 | 796 | * @param $linestart bool |
797 | 797 | * @param $language |
798 | 798 | * @return ParserOutput |
799 | 799 | */ |
800 | | - public function parse( $text, $title = null, $linestart = true, $interface = false, $language = null ) { |
| 800 | + public function parse( $text, $key, $linestart = true, $interface = false, $language = null ) { |
801 | 801 | if ( $this->mInParser ) { |
802 | 802 | return htmlspecialchars( $text ); |
803 | 803 | } |
— | — | @@ -811,6 +811,9 @@ |
812 | 812 | $popts->setTargetLanguage( $language ); |
813 | 813 | } |
814 | 814 | |
| 815 | + if ( !($key instanceof Title) ) { |
| 816 | + $title = Title::newFromText( $key, NS_MEDIAWIKI ); |
| 817 | + } |
815 | 818 | $this->mInParser = true; |
816 | 819 | $res = $parser->parse( $text, $title, $popts, $linestart ); |
817 | 820 | $this->mInParser = false; |
Index: trunk/phase3/includes/Message.php |
— | — | @@ -432,7 +432,7 @@ |
433 | 433 | * @return string Wikitext parsed into HTML |
434 | 434 | */ |
435 | 435 | protected function parseText( $string ) { |
436 | | - return MessageCache::singleton()->parse( $string, null, /*linestart*/true, $this->interface, $this->language )->getText(); |
| 436 | + return MessageCache::singleton()->parse( $string, $this->key, /*linestart*/true, $this->interface, $this->language )->getText(); |
437 | 437 | } |
438 | 438 | |
439 | 439 | /** |