Avoid strip markes on transcluded Special:RecentChanges[Linked]
authorumherirrender <umherirrender_de.wp@web.de>
Fri, 25 Oct 2013 16:44:27 +0000 (18:44 +0200)
committerIAlex <codereview@emsenhuber.ch>
Thu, 31 Oct 2013 10:41:13 +0000 (10:41 +0000)
OutputPage::wrapWikiText results in a Parser::parse call, which should
not be done recursively. Using workaround from the warning under
https://www.mediawiki.org?oldid=807703#OutputPage-.3EaddWikiText.28.29

This only was happen, when the special page has no result or for
RecentChangesLinked a bad title was given.

Bug: 56167
Change-Id: I334bc6c36800af80e311301d46c7d48be1b6a055

includes/specials/SpecialRecentchanges.php
includes/specials/SpecialRecentchangeslinked.php

index a42a217..51e7450 100644 (file)
@@ -517,8 +517,8 @@ class SpecialRecentChanges extends IncludableSpecialPage {
                }
 
                if ( $rows->numRows() === 0 ) {
-                       $this->getOutput()->wrapWikiMsg(
-                               "<div class='mw-changeslist-empty'>\n$1\n</div>", 'recentchanges-noresult'
+                       $this->getOutput()->addHtml(
+                               '<div class="mw-changeslist-empty">' . $this->msg( 'recentchanges-noresult' )->parse() . '</div>'
                        );
                } else {
                        $this->getOutput()->addHTML( $rclistOutput );
index a844704..f37ea20 100644 (file)
@@ -72,7 +72,7 @@ class SpecialRecentchangeslinked extends SpecialRecentChanges {
                $outputPage = $this->getOutput();
                $title = Title::newFromURL( $target );
                if ( !$title || $title->getInterwiki() != '' ) {
-                       $outputPage->wrapWikiMsg( "<div class=\"errorbox\">\n$1\n</div>", 'allpagesbadtitle' );
+                       $outputPage->addHtml( '<div class="errorbox">' . $this->msg( 'allpagesbadtitle' )->parse() . '</div>' );
                        return false;
                }