From efca2a63ee0d89dd82bf7b7b2936e86174a99ad5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Niklas=20Laxstr=C3=B6m?= Date: Tue, 16 Aug 2005 13:27:00 +0000 Subject: [PATCH] Bug 3116: Division by zero on [[Image:Foo.png|123x123px|]] See Bug 3129 --- RELEASE-NOTES | 2 ++ includes/Linker.php | 3 ++- includes/SpecialExport.php | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 69057f4edd..8b04c37454 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -21,6 +21,8 @@ Misc work going on..... * (bug 2323) Remove "last" tabindex from history page * (bug 3141) Partial support for Breton language (thanks Fulup). * Partial support for Basque language (from wikipedia and meta) +* (bug 3116) Division by zero on [[Image:Foo.png|123x123px|]] + === Caveats === diff --git a/includes/Linker.php b/includes/Linker.php index d4e99d864f..81c290c745 100644 --- a/includes/Linker.php +++ b/includes/Linker.php @@ -419,8 +419,9 @@ class Linker { } return $prefix.$this->makeThumbLinkObj( $img, $label, $alt, $align, $width, $height, $framed, $manual_thumb ).$postfix; + } - } elseif ( $width ) { + if ( $width && $img->exists() ) { # Create a resized image, without the additional thumbnail # features diff --git a/includes/SpecialExport.php b/includes/SpecialExport.php index 40fef6a931..5fda2be58e 100644 --- a/includes/SpecialExport.php +++ b/includes/SpecialExport.php @@ -236,7 +236,7 @@ class WikiExporter { function pageByName( $name ) { $title = Title::newFromText( $name ); if( is_null( $title ) ) { - return WikiError( "Can't export invalid title" ); + return new WikiError( "Can't export invalid title" ); } else { return $this->pageByTitle( $title ); } -- 2.20.1