From f71cd4d3dbad5d571ae6bd1e45c7a64319f0e7b2 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Sun, 1 Jul 2007 13:56:05 +0000 Subject: [PATCH] Fixed unnecessary use of the replaceafter option to wfMsgExt(). Using it causes links generated in wikitext from parameters to not work, due to conversion of $1 to %241. This does mean the success links are coloured like external links, but on the plus side, it means you can have things like "check [[Special:Whatlinkshere/$1|what links here]] and fix double redirects". Backwards compatibility with messages is retained. --- includes/SpecialMovepage.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/includes/SpecialMovepage.php b/includes/SpecialMovepage.php index ad4011efdf..555877bb48 100644 --- a/includes/SpecialMovepage.php +++ b/includes/SpecialMovepage.php @@ -274,22 +274,25 @@ class MovePageForm { $old = Title::newFromText( $wgRequest->getText( 'oldtitle' ) ); $new = Title::newFromText( $wgRequest->getText( 'newtitle' ) ); $talkmoved = $wgRequest->getVal( 'talkmoved' ); - - $olink = $wgUser->getSkin()->makeKnownLinkObj( $old, '', 'redirect=no' ); - $nlink = $wgUser->getSkin()->makeKnownLinkObj( $new ); + $oldUrl = $old->getFullUrl( 'redirect=no' ); + $newUrl = $new->getFullURl(); + $oldText = $old->getPrefixedText(); + $newText = $new->getPrefixedText(); + $oldLink = "[$oldUrl $oldText]"; + $newLink = "[$newUrl $newText]"; - $wgOut->addHtml( wfMsgExt( 'movepage-moved', array( 'parseinline', 'replaceafter' ), - $olink, $nlink, $old->getPrefixedText(), $new->getPrefixedText() ) ); + $s = wfMsg( 'movepage-moved', $oldLink, $newLink, $oldText, $newText ); if ( $talkmoved == 1 ) { - $wgOut->addWikiText( wfMsg( 'talkpagemoved' ) ); + $s .= "\n\n" . wfMsg( 'talkpagemoved' ); } elseif( 'articleexists' == $talkmoved ) { - $wgOut->addWikiText( wfMsg( 'talkexists' ) ); + $s .= "\n\n" . wfMsg( 'talkexists' ); } else { if( !$old->isTalkPage() && $talkmoved != 'notalkpage' ) { - $wgOut->addWikiText( wfMsg( 'talkpagenotmoved', wfMsg( $talkmoved ) ) ); + $s .= "\n\n" . wfMsg( 'talkpagenotmoved', wfMsg( $talkmoved ) ); } } + $wgOut->addWikiText( $s ); } function showLogFragment( $title, &$out ) { -- 2.20.1