Merge pull request #3726 from willmorgan/bugfixes/gd-image-exists

FIX: GD - check file exists before getimagesize
This commit is contained in:
Damian Mooyman 2014-12-12 08:30:39 +13:00
commit 644f38f2d6

View File

@ -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) {