From 30d1fae9bbd1730b9b143c166e7f12c0e2ae5e6a Mon Sep 17 00:00:00 2001 From: zyxist Date: Wed, 1 Sep 2010 13:22:14 +0200 Subject: [PATCH] Adding "jpeg" extension support to isImage() function. --- lib/Function.php | 2 +- tests/function/isimage_1.txt | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Function.php b/lib/Function.php index 77c7dc3..e9519fd 100644 --- a/lib/Function.php +++ b/lib/Function.php @@ -597,7 +597,7 @@ static public function isImage($address) // Try to obtain the file extension if(($id = strrpos($result['path'], '.')) !== false) { - if(in_array(substr($result['path'], $id+1, 3), array('jpg', 'png', 'gif', 'svg', 'bmp'))) + if(in_array(substr($result['path'], $id+1, 3), array('jpg', 'png', 'gif', 'svg', 'bmp')) || in_array(substr($result['path'], $id+1, 4), array('jpeg'))) { return true; } diff --git a/tests/function/isimage_1.txt b/tests/function/isimage_1.txt index c02297e..995da55 100644 --- a/tests/function/isimage_1.txt +++ b/tests/function/isimage_1.txt @@ -8,6 +8,7 @@ Check the isImage() function. IMAGENOT IMAGE IMAGENOT IMAGE IMAGENOT IMAGE +IMAGENOT IMAGE IMAGENOT IMAGE IMAGENOT IMAGE @@ -22,4 +23,5 @@ IMAGE IMAGE IMAGE IMAGE +IMAGE NOT IMAGE \ No newline at end of file