From b5c361a66c3904fef6de0811ce59945280c04549 Mon Sep 17 00:00:00 2001 From: Will Morgan Date: Thu, 11 Dec 2014 15:21:38 +0000 Subject: [PATCH] FIX: GD - check file exists before getimagesize Use is_readable to check the file exists and is readable --- filesystem/GD.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/filesystem/GD.php b/filesystem/GD.php index a923d86f7..fe4ffe5ce 100644 --- a/filesystem/GD.php +++ b/filesystem/GD.php @@ -38,7 +38,7 @@ class GDBackend extends Object implements Image_Backend { // If we're working with image resampling, things could take a while. Bump up the time-limit increase_time_limit_to(300); - if($filename) { + if($filename && is_readable($filename)) { // We use getimagesize instead of extension checking, because sometimes extensions are wrong. list($width, $height, $type, $attr) = getimagesize($filename); switch($type) {