From 32a2100217115e0cc0776d936df7b19965455f2a Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Sun, 24 May 2009 09:19:28 +0000 Subject: Make img_dimensions() return early if the width or height is zero (probably a broken image). --- core/helpers/photo.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/helpers') diff --git a/core/helpers/photo.php b/core/helpers/photo.php index 9e468116..c1c005f5 100644 --- a/core/helpers/photo.php +++ b/core/helpers/photo.php @@ -155,6 +155,10 @@ class photo_Core { * @param string $format the output format using %d placeholders for width and height */ static function img_dimensions($width, $height, $max, $format="width=\"%d\" height=\"%d\"") { + if (!$width || !$height) { + return ""; + } + if ($width > $height) { $new_width = $max; $new_height = (int)$max * ($height / $width); -- cgit v1.2.3