From 562c3572418de33dabeebd3edb8bedd078818757 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 6 Apr 2011 18:45:27 +0000 Subject: [PATCH] * (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. --- RELEASE-NOTES | 1 + includes/ImagePage.php | 32 ++++++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 7105e791a0..bdb16cf99c 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -230,6 +230,7 @@ PHP if you have not done so prior to upgrading MediaWiki. * (bug 28395) Set forgotten parameters types in ApiParse * (bug 28430) Make html and TeX output of always be left-to-right. * (bug 28306) Fix exposure of suppressed usernames in ForeignDBRepo +* (bug 28372) Fix bogus link to suppressed file versions in ForeignDBRepo === API changes in 1.18 === * (bug 26339) Throw warning when truncating an overlarge API result diff --git a/includes/ImagePage.php b/includes/ImagePage.php index b1304f5ba0..c1555292fc 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -1045,20 +1045,24 @@ class ImageHistoryList { # Don't link to unviewable files $row .= '' . $wgLang->timeAndDate( $timestamp, true ) . ''; } elseif ( $file->isDeleted( File::DELETED_FILE ) ) { - $this->preventClickjacking(); - $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); - # Make a link to review the image - $url = $this->skin->link( - $revdel, - $wgLang->timeAndDate( $timestamp, true ), - array(), - array( - 'target' => $this->title->getPrefixedText(), - 'file' => $img, - 'token' => $wgUser->editToken( $img ) - ), - array( 'known', 'noclasses' ) - ); + if ( $local ) { + $this->preventClickjacking(); + $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); + # Make a link to review the image + $url = $this->skin->link( + $revdel, + $wgLang->timeAndDate( $timestamp, true ), + array(), + array( + 'target' => $this->title->getPrefixedText(), + 'file' => $img, + 'token' => $wgUser->editToken( $img ) + ), + array( 'known', 'noclasses' ) + ); + } else { + $url = $wgLang->timeAndDate( $timestamp, true ); + } $row .= '' . $url . ''; } else { $url = $iscur ? $this->current->getUrl() : $this->current->getArchiveUrl( $img ); -- 2.20.1