X-Git-Url: https://git.cyclocoop.org/%28%28?a=blobdiff_plain;f=thumb.php;h=70cd1e67af1d4178a629bd28c540d694320a4545;hb=7df76bae3b7ecb2a73f34ecc4f5b72c9de19d0f8;hp=28f22fd4833094ae47df9c8b6c9cd1b4db11d6cd;hpb=8ad81cbb7538d837c0e2b5ce337b71f2d07f02a8;p=lhc%2Fweb%2Fwiklou.git diff --git a/thumb.php b/thumb.php index 28f22fd483..70cd1e67af 100644 --- a/thumb.php +++ b/thumb.php @@ -252,10 +252,12 @@ function wfStreamThumb( array $params ) { try { $thumbName = $img->thumbName( $params ); if ( !strlen( $thumbName ) ) { // invalid params? - wfThumbError( 400, 'The specified thumbnail parameters are not valid.' ); - return; + throw new MediaTransformInvalidParametersException( 'Empty return from File::thumbName' ); } $thumbName2 = $img->thumbName( $params, File::THUMB_FULL_NAME ); // b/c; "long" style + } catch ( MediaTransformInvalidParametersException $e ) { + wfThumbError( 400, 'The specified thumbnail parameters are not valid: ' . $e->getMessage() ); + return; } catch ( MWException $e ) { wfThumbError( 500, $e->getHTML() ); return;