diff options
author | Mario <mario@mariovavti.com> | 2021-08-17 07:53:07 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2021-08-17 09:59:03 +0200 |
commit | 952407363e245d41986cfb90e4ccf509bddc7322 (patch) | |
tree | fcc67a725b2dd5f221718ecbac4c4017754e00c6 | |
parent | 2deb75de8d86803922cea949c16e1b21a486ca6d (diff) | |
download | volse-hubzilla-952407363e245d41986cfb90e4ccf509bddc7322.tar.gz volse-hubzilla-952407363e245d41986cfb90e4ccf509bddc7322.tar.bz2 volse-hubzilla-952407363e245d41986cfb90e4ccf509bddc7322.zip |
make sure we have a path before running getimagesize() on it
(cherry picked from commit a2403042c25a9202e8b926962c5035d34c0e08a3)
-rw-r--r-- | include/attach.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/attach.php b/include/attach.php index 09d4005e8..56fb936e7 100644 --- a/include/attach.php +++ b/include/attach.php @@ -658,8 +658,12 @@ function attach_store($channel, $observer_hash, $options = '', $arr = null) { $def_extension = ''; $is_photo = 0; - $gis = @getimagesize($src); - logger('getimagesize: ' . print_r($gis,true), LOGGER_DATA); + + if ($src) { + $gis = @getimagesize($src); + logger('getimagesize: ' . print_r($gis,true), LOGGER_DATA); + } + if(($gis) && ($gis[2] === IMAGETYPE_GIF || $gis[2] === IMAGETYPE_JPEG || $gis[2] === IMAGETYPE_PNG || $gis[2] === IMAGETYPE_WEBP)) { $is_photo = 1; if($gis[2] === IMAGETYPE_GIF) |