From a1789ddde42033f1b05cc4929491214ee6e79383 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Thu, 17 Dec 2015 09:15:42 +0100 Subject: Update to MediaWiki 1.26.0 --- includes/page/ImagePage.php | 35 ++++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 9 deletions(-) (limited to 'includes/page/ImagePage.php') diff --git a/includes/page/ImagePage.php b/includes/page/ImagePage.php index 8f635cfa..9b9e3cbd 100644 --- a/includes/page/ImagePage.php +++ b/includes/page/ImagePage.php @@ -219,6 +219,9 @@ class ImagePage extends Article { } // always show the local local Filepage.css, bug 29277 $out->addModuleStyles( 'filepage' ); + + // Add MediaWiki styles for a file page + $out->addModuleStyles( 'mediawiki.action.view.filepage' ); } /** @@ -296,7 +299,7 @@ class ImagePage extends Article { } protected function openShowImage() { - global $wgEnableUploads, $wgSend404Code; + global $wgEnableUploads, $wgSend404Code, $wgSVGMaxSize; $this->loadFile(); $out = $this->getContext()->getOutput(); @@ -351,7 +354,7 @@ class ImagePage extends Article { ); $linktext = $this->getContext()->msg( 'show-big-image' )->escaped(); - $thumbSizes = $this->getThumbSizes( $width, $height, $width_orig, $height_orig ); + $thumbSizes = $this->getThumbSizes( $width_orig, $height_orig ); # Generate thumbnails or thumbnail links as needed... $otherSizes = array(); foreach ( $thumbSizes as $size ) { @@ -361,10 +364,12 @@ class ImagePage extends Article { // the current thumbnail's size ($width/$height) // since that is added to the message separately, so // it can be denoted as the current size being shown. - // Vectorized images are "infinitely" big, so all thumb - // sizes are shown. + // Vectorized images are limited by $wgSVGMaxSize big, + // so all thumbs less than or equal that are shown. if ( ( ( $size[0] <= $width_orig && $size[1] <= $height_orig ) - || $this->displayImg->isVectorized() ) + || ( $this->displayImg->isVectorized() + && max( $size[0], $size[1] ) <= $wgSVGMaxSize ) + ) && $size[0] != $width && $size[1] != $height ) { $sizeLink = $this->makeSizeLink( $params, $size[0], $size[1] ); @@ -614,8 +619,8 @@ EOT $out->wrapWikiMsg( "", $nofile ); if ( !$this->getID() && $wgSend404Code ) { // If there is no image, no shared image, and no description page, - // output a 404, to be consistent with articles. - $request->response()->header( 'HTTP/1.1 404 Not Found' ); + // output a 404, to be consistent with Article::showMissingArticle. + $request->response()->statusHeader( 404 ); } } $out->setFileVersion( $this->displayImg ); @@ -704,10 +709,10 @@ EOT $out->addHTML( "