r23604 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23603‎ | r23604 | r23605 >
Date:13:56, 1 July 2007
Author:tstarling
Status:old
Tags:
Comment:
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.
Modified paths:
  • /trunk/phase3/includes/SpecialMovepage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialMovepage.php
@@ -274,22 +274,25 @@
275275 $old = Title::newFromText( $wgRequest->getText( 'oldtitle' ) );
276276 $new = Title::newFromText( $wgRequest->getText( 'newtitle' ) );
277277 $talkmoved = $wgRequest->getVal( 'talkmoved' );
278 -
279 - $olink = $wgUser->getSkin()->makeKnownLinkObj( $old, '', 'redirect=no' );
280 - $nlink = $wgUser->getSkin()->makeKnownLinkObj( $new );
 278+ $oldUrl = $old->getFullUrl( 'redirect=no' );
 279+ $newUrl = $new->getFullURl();
 280+ $oldText = $old->getPrefixedText();
 281+ $newText = $new->getPrefixedText();
 282+ $oldLink = "<span class='plainlinks'>[$oldUrl $oldText]</span>";
 283+ $newLink = "<span class='plainlinks'>[$newUrl $newText]</span>";
281284
282 - $wgOut->addHtml( wfMsgExt( 'movepage-moved', array( 'parseinline', 'replaceafter' ),
283 - $olink, $nlink, $old->getPrefixedText(), $new->getPrefixedText() ) );
 285+ $s = wfMsg( 'movepage-moved', $oldLink, $newLink, $oldText, $newText );
284286
285287 if ( $talkmoved == 1 ) {
286 - $wgOut->addWikiText( wfMsg( 'talkpagemoved' ) );
 288+ $s .= "\n\n" . wfMsg( 'talkpagemoved' );
287289 } elseif( 'articleexists' == $talkmoved ) {
288 - $wgOut->addWikiText( wfMsg( 'talkexists' ) );
 290+ $s .= "\n\n" . wfMsg( 'talkexists' );
289291 } else {
290292 if( !$old->isTalkPage() && $talkmoved != 'notalkpage' ) {
291 - $wgOut->addWikiText( wfMsg( 'talkpagenotmoved', wfMsg( $talkmoved ) ) );
 293+ $s .= "\n\n" . wfMsg( 'talkpagenotmoved', wfMsg( $talkmoved ) );
292294 }
293295 }
 296+ $wgOut->addWikiText( $s );
294297 }
295298
296299 function showLogFragment( $title, &$out ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r23662Merged revisions 23581-23661 via svnmerge from...david03:01, 3 July 2007

Status & tagging log