From: Brian Wolff Date: Thu, 14 Aug 2014 20:24:50 +0000 (-0300) Subject: Make sure processResponsiveImages checks for valid thumb object X-Git-Tag: 1.31.0-rc.0~14014^2 X-Git-Url: http://git.cyclocoop.org/%24action?a=commitdiff_plain;h=c2665e2cb249f3f329dfdef8a22979d68172d115;p=lhc%2Fweb%2Fwiklou.git Make sure processResponsiveImages checks for valid thumb object If the thumbnail is an error (or worse yet, if the MediaHandler returns false, like TMH does in certain circumstances), we should not add responsive thumbnail links. Change-Id: I2aafbd07e8435ce2d1b4cb32e49e98cb5f6c00ab --- diff --git a/includes/Linker.php b/includes/Linker.php index d9f4255e68..012bc1ba64 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -897,7 +897,7 @@ class Linker { */ public static function processResponsiveImages( $file, $thumb, $hp ) { global $wgResponsiveImages; - if ( $wgResponsiveImages ) { + if ( $wgResponsiveImages && $thumb && !$thumb->isError() ) { $hp15 = $hp; $hp15['width'] = round( $hp['width'] * 1.5 ); $hp20 = $hp;