r21745 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r21744‎ | r21745 | r21746 >
Date:09:10, 1 May 2007
Author:nickj
Status:old
Tags:
Comment:
Cast oldid to int to save people injecting random crap into the
oldid parameter (it was HTML escaped, but it could be used to make tidy
whinge about "escaping malformed URI reference"). Also there doesn't seem
to be a need to pass the integer parameters by reference, so remove that.
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=$oldid" )
 48+ 'href' => $skintemplate->makeSpecialUrl( 'Cite', "page=" . wfUrlencode( "{$skintemplate->thispage}" ) . "&id=" . intval( $oldid ) )
4949 );
5050
5151 return true;

Follow-up revisions

RevisionCommit summaryAuthorDate
r21760Revert r21745, r21744, as they don't work properly....brion17:40, 1 May 2007