(bug 17304) Fatal error in file history when File::transform() fails.
authorChad Horohoe <demon@users.mediawiki.org>
Sun, 1 Feb 2009 23:09:56 +0000 (23:09 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Sun, 1 Feb 2009 23:09:56 +0000 (23:09 +0000)
RELEASE-NOTES
includes/ImagePage.php
includes/filerepo/File.php

index 212ac0a..603373a 100644 (file)
@@ -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
index aea40a9..fb4fe24 100644 (file)
@@ -918,7 +918,8 @@ class ImageHistoryList {
                                'alt' => wfMsg( 'filehist-thumbtext', $wgLang->timeAndDate( $timestamp, true ) ),
                                'file-link' => true,
                        );
-                       $row .= '</td><td>' . $thumbnail->toHtml( $options );
+                       $row .= '</td><td>' . ( $thumbnail ? $thumbnail->toHtml( $options ) : 
+                                                                                                       wfMsgHtml( 'filehist-nothumb' ) );
                } else {
                        $row .= '</td><td>' . wfMsgHtml( 'filehist-nothumb' );
                }
index 4ea9c28..47b1d4e 100644 (file)
@@ -586,7 +586,7 @@ abstract class File {
                } while (false);
 
                wfProfileOut( __METHOD__ );
-               return $thumb;
+               return is_object( $thumb ) ? $thumb : false;
        }
 
        /**