diff options
author | Mario <mario@mariovavti.com> | 2020-10-31 13:53:13 +0100 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2020-10-31 13:53:13 +0100 |
commit | b11d2c376b130b33589f381be9d5d55b32d9a7cb (patch) | |
tree | 93194e33ea46a5c54b834ce0f95c11bb570e4e38 /Zotlabs | |
parent | 6d83b5b68d176183e147c11e40aaedf8d68e36df (diff) | |
parent | 7cf9b85a97829dc6e11fef4dcafeebe746084c1f (diff) | |
download | volse-hubzilla-b11d2c376b130b33589f381be9d5d55b32d9a7cb.tar.gz volse-hubzilla-b11d2c376b130b33589f381be9d5d55b32d9a7cb.tar.bz2 volse-hubzilla-b11d2c376b130b33589f381be9d5d55b32d9a7cb.zip |
Merge branch 'dev' into 'dev'
Don't try to fetch profile photo for unknown channel
See merge request hubzilla/core!1880
Diffstat (limited to 'Zotlabs')
-rw-r--r-- | Zotlabs/Module/Photo.php | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/Zotlabs/Module/Photo.php b/Zotlabs/Module/Photo.php index 1cf082bdd..c88696578 100644 --- a/Zotlabs/Module/Photo.php +++ b/Zotlabs/Module/Photo.php @@ -67,18 +67,20 @@ class Photo extends \Zotlabs\Web\Controller { $data = ''; - $r = q("SELECT * FROM photo WHERE imgscale = %d AND uid = %d AND photo_usage = %d LIMIT 1", - intval($resolution), - intval($uid), - intval(PHOTO_PROFILE) - ); - if($r) { - $modified = strtotime($r[0]['edited'] . "Z"); - $mimetype = $r[0]['mimetype']; - if(intval($r[0]['os_storage'])) - $data = file_get_contents(dbunescbin($r[0]['content'])); - else - $data = dbunescbin($r[0]['content']); + if ($uid > 0) { + $r = q("SELECT * FROM photo WHERE imgscale = %d AND uid = %d AND photo_usage = %d LIMIT 1", + intval($resolution), + intval($uid), + intval(PHOTO_PROFILE) + ); + if($r) { + $modified = strtotime($r[0]['edited'] . "Z"); + $mimetype = $r[0]['mimetype']; + if(intval($r[0]['os_storage'])) + $data = file_get_contents(dbunescbin($r[0]['content'])); + else + $data = dbunescbin($r[0]['content']); + } } if(! $data) { |