From be0021f2955c32ef0199a9456519d1146f346200 Mon Sep 17 00:00:00 2001 From: Jens Frank Date: Wed, 11 Aug 2004 22:24:06 +0000 Subject: [PATCH] Prevent division-by-zero-errors. BUG#1007562 --- includes/Skin.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/includes/Skin.php b/includes/Skin.php index 12aec53acb..712fa9e22c 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1891,13 +1891,20 @@ class Skin { $alt = preg_replace( '/<[^>]*>/', '', $label); $alt = htmlspecialchars( $alt ); + $width = $height = 0; if ( $img->exists() ) { $width = $img->getWidth(); $height = $img->getHeight(); - } else { + } + if ( 0 == $width || 0 == $height ) + { $width = $height = 200; } + if ( $boxwidth == 0 ) + { + $boxwidth = 200; + } if ( $framed ) { // Use image dimensions, don't scale -- 2.20.1