Fix double braceSubstitution of some preview messages
[lhc/web/wiklou.git] / includes / OutputPage.php
index bf70467..e9e2b6f 100644 (file)
@@ -1725,7 +1725,7 @@ class OutputPage extends ContextSource {
        /**
         * Return a Vary: header on which to vary caches. Based on the keys of $mVaryHeader,
         * such as Accept-Encoding or Cookie
-        * 
+        *
         * @return String
         */
        public function getVaryHeader() {
@@ -2053,13 +2053,18 @@ class OutputPage extends ContextSource {
         *
         * showErrorPage( 'titlemsg', 'pagetextmsg', array( 'param1', 'param2' ) );
         * showErrorPage( 'titlemsg', $messageObject );
+        * showErrorPage( $titleMessageObj, $messageObject );
         *
-        * @param $title String: message key for page title
+        * @param $title Mixed: message key (string) for page title, or a Message object
         * @param $msg Mixed: message key (string) for page text, or a Message object
         * @param $params Array: message parameters; ignored if $msg is a Message object
         */
        public function showErrorPage( $title, $msg, $params = array() ) {
-               $this->prepareErrorPage( $this->msg( $title ), $this->msg( 'errorpagetitle' ) );
+               if( !$title instanceof Message ) {
+                       $title = $this->msg( $title );
+               }
+
+               $this->prepareErrorPage( $title );
 
                if ( $msg instanceof Message ){
                        $this->addHTML( $msg->parse() );
@@ -2346,7 +2351,7 @@ $templates
         * Add a "return to" link pointing to a specified title
         *
         * @param $title Title to link
-        * @param $query String query string
+        * @param $query Array query string parameters
         * @param $text String text of the link (input is not escaped)
         */
        public function addReturnTo( $title, $query = array(), $text = null ) {
@@ -2386,7 +2391,7 @@ $templates
                        $titleObj = Title::newMainPage();
                }
 
-               $this->addReturnTo( $titleObj, $returntoquery );
+               $this->addReturnTo( $titleObj, wfCgiToArray( $returntoquery ) );
        }
 
        /**
@@ -3516,7 +3521,7 @@ $templates
         * Add a wikitext-formatted message to the output.
         * This is equivalent to:
         *
-        *    $wgOut->addWikiText( wfMsgNoTrans( ... ) )
+        *    $wgOut->addWikiText( wfMessage( ... )->plain() )
         */
        public function addWikiMsg( /*...*/ ) {
                $args = func_get_args();