X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=thumb.php;h=c38b89c251a657607a21425dc73323de7aa03c87;hb=5eaf2e1f15b03a3665d89176311c07d4c418e55d;hp=fca25c55d28b51145c3da147aea3f73593f1e649;hpb=500889f19005b4aed93c5b6eaafd35689fce7dcd;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() ) {