* (bug 4167) Fix regression caused by patch for bug 153
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 5 Dec 2005 06:14:49 +0000 (06:14 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 5 Dec 2005 06:14:49 +0000 (06:14 +0000)
New code didn't check for null thumbnail (deleted or nonexistent images)

RELEASE-NOTES
includes/Linker.php

index 843c5eb..671e7c7 100644 (file)
@@ -294,6 +294,7 @@ fully support the editing toolbar, but was found to be too confusing.
 * (bug 4165) Correct validation for user language selection (data taint)
 * Add createpage and createtalk permission keys, allowing a quick
   switch to disable page creation for anonymous users.
+* (bug 4167) Fix regression caused by patch for bug 153
 
 
 === Caveats ===
index d9cd2b6..4ffca4f 100644 (file)
@@ -500,12 +500,11 @@ class Linker {
                                $boxheight = -1;
                        if ( '' == $manual_thumb ) {
                                $thumb = $img->getThumbnail( $boxwidth, $boxheight );
-                               if ( is_null( $thumb ) ) {
-                                       return '<b>FATAL ERROR: Thumb object NULL in Linker.php:504</b>';
+                               if ( $thumb ) {
+                                       $thumbUrl = $thumb->getUrl();
+                                       $boxwidth = $thumb->width;
+                                       $boxheight = $thumb->height;
                                }
-                               $thumbUrl = $thumb->getUrl();
-                               $boxwidth = $thumb->width;
-                               $boxheight = $thumb->height;
                        }
                }
                $oboxwidth = $boxwidth + 2;