r85560 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r85559‎ | r85560 | r85561 >
Date:18:45, 6 April 2011
Author:brion
Status:ok
Tags:
Comment:
* (bug 28372) Fix bogus link to suppressed file versions in ForeignDBRepo

Based on patch by Umherirrender: https://bugzilla.wikimedia.org/attachment.cgi?id=8361&action=edit
If file is not local, we can't make a link so don't.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/ImagePage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/ImagePage.php
@@ -1045,20 +1045,24 @@
10461046 # Don't link to unviewable files
10471047 $row .= '<span class="history-deleted">' . $wgLang->timeAndDate( $timestamp, true ) . '</span>';
10481048 } elseif ( $file->isDeleted( File::DELETED_FILE ) ) {
1049 - $this->preventClickjacking();
1050 - $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
1051 - # Make a link to review the image
1052 - $url = $this->skin->link(
1053 - $revdel,
1054 - $wgLang->timeAndDate( $timestamp, true ),
1055 - array(),
1056 - array(
1057 - 'target' => $this->title->getPrefixedText(),
1058 - 'file' => $img,
1059 - 'token' => $wgUser->editToken( $img )
1060 - ),
1061 - array( 'known', 'noclasses' )
1062 - );
 1049+ if ( $local ) {
 1050+ $this->preventClickjacking();
 1051+ $revdel = SpecialPage::getTitleFor( 'Revisiondelete' );
 1052+ # Make a link to review the image
 1053+ $url = $this->skin->link(
 1054+ $revdel,
 1055+ $wgLang->timeAndDate( $timestamp, true ),
 1056+ array(),
 1057+ array(
 1058+ 'target' => $this->title->getPrefixedText(),
 1059+ 'file' => $img,
 1060+ 'token' => $wgUser->editToken( $img )
 1061+ ),
 1062+ array( 'known', 'noclasses' )
 1063+ );
 1064+ } else {
 1065+ $url = $wgLang->timeAndDate( $timestamp, true );
 1066+ }
10631067 $row .= '<span class="history-deleted">' . $url . '</span>';
10641068 } else {
10651069 $url = $iscur ? $this->current->getUrl() : $this->current->getArchiveUrl( $img );
Index: trunk/phase3/RELEASE-NOTES
@@ -230,6 +230,7 @@
231231 * (bug 28395) Set forgotten parameters types in ApiParse
232232 * (bug 28430) Make html and TeX output of <math> always be left-to-right.
233233 * (bug 28306) Fix exposure of suppressed usernames in ForeignDBRepo
 234+* (bug 28372) Fix bogus link to suppressed file versions in ForeignDBRepo
234235
235236 === API changes in 1.18 ===
236237 * (bug 26339) Throw warning when truncating an overlarge API result

Status & tagging log