From: umherirrender Date: Sat, 2 Feb 2013 11:29:49 +0000 (+0100) Subject: Show no size links on image pages with errors X-Git-Tag: 1.31.0-rc.0~20776^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/recherche.php?a=commitdiff_plain;h=d1647fe4ac03cc8f0ca7efbd1cd72d2650c30f0c;p=lhc%2Fweb%2Fwiklou.git Show no size links on image pages with errors This avoids useless "Size of this preview: . Other resolutions: | | | ." on image pages. Change-Id: Ieb2787a736ec5ae409ad17dd9919f4975f0b843e --- diff --git a/includes/ImagePage.php b/includes/ImagePage.php index a54bd92143..3d70fa5ca7 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -369,12 +369,19 @@ class ImagePage extends Article { if ( $size[0] < $width_orig && $size[1] < $height_orig && $size[0] != $width && $size[1] != $height ) { - $otherSizes[] = $this->makeSizeLink( $params, $size[0], $size[1] ); + $sizeLink = $this->makeSizeLink( $params, $size[0], $size[1] ); + if ( $sizeLink ) { + $otherSizes[] = $sizeLink; + } } } - $msgsmall = wfMessage( 'show-big-image-preview' )-> - rawParams( $this->makeSizeLink( $params, $width, $height ) )-> - parse(); + $msgsmall = ''; + $sizeLinkBigImagePreview = $this->makeSizeLink( $params, $width, $height ); + if ( $sizeLinkBigImagePreview ) { + $msgsmall .= wfMessage( 'show-big-image-preview' )-> + rawParams( $sizeLinkBigImagePreview )-> + parse(); + } if ( count( $otherSizes ) ) { $msgsmall .= ' ' . Html::rawElement( 'span', array( 'class' => 'mw-filepage-other-resolutions' ),