From 0f6da81bcb24bd8605c56fcae9f9ea8b8bef22e5 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Wed, 25 Apr 2007 07:40:22 +0000 Subject: [PATCH] better error messages --- thumb.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/thumb.php b/thumb.php index c67468b694..4ca24ed77f 100644 --- a/thumb.php +++ b/thumb.php @@ -71,7 +71,7 @@ try { $thumb = false; } -if ( $thumb && $thumb->getPath() ) { +if ( $thumb && $thumb->getPath() && file_exists( $thumb->getPath() ) ) { wfStreamFile( $thumb->getPath() ); } elseif ( $img ) { header( 'Cache-Control: no-cache' ); @@ -80,14 +80,19 @@ if ( $thumb && $thumb->getPath() ) { if ( !$thumb ) { $msg = wfMsgHtml( 'thumbnail_error', 'Image::transform() returned false' ); } elseif ( $thumb->isError() ) { - $msg = $thumb->toHtml(); - } else { + $msg = $thumb->getHtmlMsg(); + } elseif ( !$thumb->getPath() ) { $msg = wfMsgHtml( 'thumbnail_error', 'No path supplied in thumbnail object' ); + } else { + $msg = wfMsgHtml( 'thumbnail_error', 'Output file missing' ); } echo <<Error generating thumbnail +

Error generating thumbnail

+

$msg +

-- 2.20.1