Followup I15843fab: don't show &page=1 in file link
authorjarry1250 <jarry1250@gmail.com>
Wed, 17 Oct 2012 22:00:54 +0000 (23:00 +0100)
committerjarry1250 <jarry1250@gmail.com>
Wed, 17 Oct 2012 22:00:54 +0000 (23:00 +0100)
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

index 69bdc2f..97a2d1d 100644 (file)
@@ -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;
                }