Fixed MessageCache::parseText() and fixed docs for MessageCache::parse()
authorAaron Schulz <aschulz@wikimedia.org>
Thu, 1 Nov 2012 17:13:30 +0000 (10:13 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Thu, 1 Nov 2012 17:28:52 +0000 (10:28 -0700)
Change-Id: Ia297d9d0f893451a611051f9df7db3870b4c2333

includes/Message.php
includes/cache/MessageCache.php

index 2feaed2..5a4b810 100644 (file)
@@ -629,7 +629,8 @@ class Message {
         * @return string Wikitext parsed into HTML
         */
        protected function parseText( $string ) {
-               return MessageCache::singleton()->parse( $string, $this->title, /*linestart*/true, $this->interface, $this->language )->getText();
+               $out = MessageCache::singleton()->parse( $string, $this->title, /*linestart*/true, $this->interface, $this->language );
+               return is_object( $out ) ? $out->getText() : $out;
        }
 
        /**
index 148e26b..9bf7436 100644 (file)
@@ -820,7 +820,7 @@ class MessageCache {
         * @param $linestart bool
         * @param $interface bool
         * @param $language
-        * @return ParserOutput
+        * @return ParserOutput|string
         */
        public function parse( $text, $title = null, $linestart = true, $interface = false, $language = null  ) {
                if ( $this->mInParser ) {