From 32f82aad9eb3bd2472310c8341a24602f25bce93 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Sun, 1 Feb 2009 23:09:56 +0000 Subject: [PATCH] (bug 17304) Fatal error in file history when File::transform() fails. --- RELEASE-NOTES | 2 ++ includes/ImagePage.php | 3 ++- includes/filerepo/File.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 212ac0afec..603373a73e 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -128,6 +128,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * (bug 7480) Internationalize database error message * (bug 16555) Number of links to mediawiki.org scaled back on post-installation * (bug 14938) Removing a section no longer leaves excess whitespace +* (bug 17304) Fixed fatal error when thumbnails couldn't be generated for file + history == API changes in 1.15 == * (bug 16858) Revamped list=deletedrevs to make listing deleted contributions diff --git a/includes/ImagePage.php b/includes/ImagePage.php index aea40a9981..fb4fe248fc 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -918,7 +918,8 @@ class ImageHistoryList { 'alt' => wfMsg( 'filehist-thumbtext', $wgLang->timeAndDate( $timestamp, true ) ), 'file-link' => true, ); - $row .= '' . $thumbnail->toHtml( $options ); + $row .= '' . ( $thumbnail ? $thumbnail->toHtml( $options ) : + wfMsgHtml( 'filehist-nothumb' ) ); } else { $row .= '' . wfMsgHtml( 'filehist-nothumb' ); } diff --git a/includes/filerepo/File.php b/includes/filerepo/File.php index 4ea9c2859c..47b1d4e55b 100644 --- a/includes/filerepo/File.php +++ b/includes/filerepo/File.php @@ -586,7 +586,7 @@ abstract class File { } while (false); wfProfileOut( __METHOD__ ); - return $thumb; + return is_object( $thumb ) ? $thumb : false; } /** -- 2.20.1