From 57a6c39f2a880b80bff84b18f04a4f38ccd39c75 Mon Sep 17 00:00:00 2001 From: shish Date: Sat, 29 Mar 2008 04:00:09 +0000 Subject: [PATCH] stable too git-svn-id: file:///home/shish/svn/shimmie2/branches/branch_2.2@733 7f39781d-f577-437e-ae19-be835c7a54ca --- ext/handle_pixel/main.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ext/handle_pixel/main.php b/ext/handle_pixel/main.php index e2f7e9d6..33fc02fa 100644 --- a/ext/handle_pixel/main.php +++ b/ext/handle_pixel/main.php @@ -72,7 +72,12 @@ class PixelFileHandler extends Extension { } private function check_contents($file) { - return (file_exists($file) && !is_null(getimagesize($file))); + $valid = Array(IMAGETYPE_PNG, IMAGETYPE_GIF, IMAGETYPE_JPEG); + if(!file_exists($file)) return false; + $info = getimagesize($file); + if(is_null($info)) return false; + if(array_contains($valid, $info[2])) return true; + return false; } private function create_thumb($hash) {