X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=thumb.php;h=c38b89c251a657607a21425dc73323de7aa03c87;hb=e3b36b255b0a7860482fd0147648bfc831ba67dc;hp=fca25c55d28b51145c3da147aea3f73593f1e649;hpb=db6f2b033a81b796ec5ab29b9057a9a920b61ebe;p=lhc%2Fweb%2Fwiklou.git diff --git a/thumb.php b/thumb.php index fca25c55d2..c38b89c251 100644 --- a/thumb.php +++ b/thumb.php @@ -341,6 +341,7 @@ function wfStreamThumb( array $params ) { // Check for thumbnail generation errors... $msg = wfMessage( 'thumbnail_error' ); $errorCode = 500; + if ( !$thumb ) { $errorMsg = $errorMsg ?: $msg->rawParams( 'File::transform() returned false' )->escaped(); if ( $errorMsg instanceof MessageSpecifier && @@ -350,6 +351,7 @@ function wfStreamThumb( array $params ) { } } elseif ( $thumb->isError() ) { $errorMsg = $thumb->getHtmlMsg(); + $errorCode = $thumb->getHttpStatusCode(); } elseif ( !$thumb->hasFile() ) { $errorMsg = $msg->rawParams( 'No path supplied in thumbnail object' )->escaped(); } elseif ( $thumb->fileIsSource() ) {