r21760 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21759‎ | r21760 | r21761 >
Date:17:40, 1 May 2007
Author:brion
Status:old
Tags:
Comment:
Revert r21745, r21744, as they don't work properly.
Seems to be taking the raw 'oldid' URL parameter, which is not necessarily the revision ID number being viewed. For instance when paging through versions, the 'oldid' parameter may reference the starting point for a directional page (with 'dir=prev' or 'dir=next' parameter). Also missing the revision number for current-revision views, losing the permalink ability. This should be using the revision number actually being viewed, which should already be known at the output/skin level for permalink etc.
Modified paths:
  • /trunk/extensions/Cite/SpecialCite.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Cite/SpecialCite.php
@@ -40,11 +40,11 @@
4141 }
4242 }
4343
44 -function wfSpecialCiteNav( &$skintemplate, &$nav_urls, $oldid, $revid ) {
 44+function wfSpecialCiteNav( &$skintemplate, &$nav_urls, &$oldid, &$revid ) {
4545 if ( $skintemplate->mTitle->getNamespace() === NS_MAIN && $revid !== 0 )
4646 $nav_urls['cite'] = array(
4747 'text' => wfMsg( 'cite_article_link' ),
48 - 'href' => $skintemplate->makeSpecialUrl( 'Cite', "page=" . wfUrlencode( "{$skintemplate->thispage}" ) . "&id=" . intval( $oldid ) )
 48+ 'href' => $skintemplate->makeSpecialUrl( 'Cite', "page=" . wfUrlencode( "{$skintemplate->thispage}" ) . "&id=$revid" )
4949 );
5050
5151 return true;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r21744Bug 9751: "Cite this page" always returns a citation for the current revision...nickj08:38, 1 May 2007
r21745Cast oldid to int to save people injecting random crap into the...nickj09:10, 1 May 2007