From c1238af7db0179c21f2910befcaeed68af9232ed Mon Sep 17 00:00:00 2001 From: shish Date: Tue, 8 Apr 2008 21:55:59 +0000 Subject: [PATCH] don't die when no ratio limits are specified git-svn-id: file:///home/shish/svn/shimmie2/trunk@790 7f39781d-f577-437e-ae19-be835c7a54ca --- contrib/res_limit/main.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/res_limit/main.php b/contrib/res_limit/main.php index f28b0edd..b7141f3a 100644 --- a/contrib/res_limit/main.php +++ b/contrib/res_limit/main.php @@ -15,6 +15,7 @@ class ResolutionLimit extends Extension { $max_w = $config->get_int("upload_max_width", -1); $max_h = $config->get_int("upload_max_height", -1); $ratios = explode(" ", $config->get_string("upload_ratios", "")); + $ratios = array_filter($ratios, "strlen"); $image = $event->image; @@ -27,6 +28,7 @@ class ResolutionLimit extends Extension { $ok = false; foreach($ratios as $ratio) { $parts = explode(":", $ratio); + if(count($parts) < 2) continue; $width = $parts[0]; $height = $parts[1]; if($image->width / $width == $image->height / $height) {