aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2021-08-17 07:53:07 +0000
committerMario <mario@mariovavti.com>2021-08-17 07:53:07 +0000
commita2403042c25a9202e8b926962c5035d34c0e08a3 (patch)
treeb117d488f82740bf6dcd44bcd212a7b95959dd96 /include
parent87cf2039adc41583cd56cf2b8b3d7639e2f02303 (diff)
downloadvolse-hubzilla-a2403042c25a9202e8b926962c5035d34c0e08a3.tar.gz
volse-hubzilla-a2403042c25a9202e8b926962c5035d34c0e08a3.tar.bz2
volse-hubzilla-a2403042c25a9202e8b926962c5035d34c0e08a3.zip
make sure we have a path before running getimagesize() on it
Diffstat (limited to 'include')
-rw-r--r--include/attach.php8
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)