mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
FIX: GD - check file exists before getimagesize
Use is_readable to check the file exists and is readable
This commit is contained in:
parent
3b3478136d
commit
b5c361a66c
@ -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
|
// If we're working with image resampling, things could take a while. Bump up the time-limit
|
||||||
increase_time_limit_to(300);
|
increase_time_limit_to(300);
|
||||||
|
|
||||||
if($filename) {
|
if($filename && is_readable($filename)) {
|
||||||
// We use getimagesize instead of extension checking, because sometimes extensions are wrong.
|
// We use getimagesize instead of extension checking, because sometimes extensions are wrong.
|
||||||
list($width, $height, $type, $attr) = getimagesize($filename);
|
list($width, $height, $type, $attr) = getimagesize($filename);
|
||||||
switch($type) {
|
switch($type) {
|
||||||
|
Loading…
Reference in New Issue
Block a user