r88078 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88077‎ | r88078 | r88079 >
Date:13:46, 14 May 2011
Author:mglaser
Status:ok
Tags:
Comment:
fixes bug 26661. getThumbType now checks mimetype in order to make sure only real tiff images are processed as such.
Modified paths:
  • /trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PagedTiffHandler/PagedTiffHandler_body.php
@@ -399,6 +399,13 @@
400400 * @return array thumbnail extension and MIME type
401401 */
402402 function getThumbType( $ext, $mime, $params=null ) {
 403+ // Make sure the file is actually a tiff image
 404+ $tiffImageThumbType = parent::getThumbType( $ext, $mime, $params );
 405+ if ( $tiffImageThumbType[1] !== 'image/tiff' ) {
 406+ // We have some other file pretending to be a tiff image.
 407+ return $tiffImageThumbType;
 408+ }
 409+
403410 if ( $params[ 'lossy' ] == 'lossy' ) {
404411 return array( 'jpg', 'image/jpeg' );
405412 } else {

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r81601Files with a mime type that does not match the extension are now properly thu...btongminh19:20, 6 February 2011

Status & tagging log