From: Bartosz DziewoƄski Date: Sun, 31 Jul 2016 00:06:10 +0000 (+0200) Subject: ImageListPager: Don't fatal when unable to thumbnail a file X-Git-Tag: 1.31.0-rc.0~6211^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/ajouter.php?a=commitdiff_plain;h=cd94b626e98cc34d85e0e076e45e961042da844f;p=lhc%2Fweb%2Fwiklou.git ImageListPager: Don't fatal when unable to thumbnail a file Change-Id: I2e2879de2b0dd4cd347bf545c46c98b891def9eb --- diff --git a/includes/specials/pagers/ImageListPager.php b/includes/specials/pagers/ImageListPager.php index 40706faaa0..5e10269cad 100644 --- a/includes/specials/pagers/ImageListPager.php +++ b/includes/specials/pagers/ImageListPager.php @@ -429,8 +429,11 @@ class ImageListPager extends TablePager { // If statement for paranoia if ( $file ) { $thumb = $file->transform( [ 'width' => 180, 'height' => 360 ] ); - - return $thumb->toHtml( [ 'desc-link' => true ] ); + if ( $thumb ) { + return $thumb->toHtml( [ 'desc-link' => true ] ); + } else { + return wfMessage( 'thumbnail_error', '' )->escaped(); + } } else { return htmlspecialchars( $value ); }