From 09e44a68fcdf8fa4c9a3a3c70d57b8891493b760 Mon Sep 17 00:00:00 2001 From: jarry1250 Date: Wed, 17 Oct 2012 23:00:54 +0100 Subject: [PATCH] Followup I15843fab: don't show &page=1 in file link By standardising the file parameters were handed around, the normalised parameter "page" (set to 1) is being passed to the linker. Since it's the default, I don't think we really need it in the link, where it is (a) meaningless and (b) confusing, since it is set for some media types that don't even have pages (e.g. SVGs). Change-Id: Ib80a85125366ec32ab05b061b06d28144dc244fc --- includes/media/MediaTransformOutput.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/includes/media/MediaTransformOutput.php b/includes/media/MediaTransformOutput.php index 69bdc2fb21..97a2d1d136 100644 --- a/includes/media/MediaTransformOutput.php +++ b/includes/media/MediaTransformOutput.php @@ -196,7 +196,10 @@ abstract class MediaTransformOutput { * @return array */ public function getDescLinkAttribs( $title = null, $params = '' ) { - $query = $this->page ? ( 'page=' . urlencode( $this->page ) ) : ''; + $query = ''; + if ( $this->page && $this->page !== 1 ) { + $query = 'page=' . urlencode( $this->page ); + } if( $params ) { $query .= $query ? '&'.$params : $params; } -- 2.20.1