From c229f058b4331e3b631d9ca725385ef78bf59778 Mon Sep 17 00:00:00 2001 From: Mario Date: Sat, 25 Apr 2020 09:15:20 +0000 Subject: fix mod filestorage and fetch the info from attach if only the hash is provided in attach_store_item() --- include/attach.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'include/attach.php') diff --git a/include/attach.php b/include/attach.php index fbf131fb3..4c2459046 100644 --- a/include/attach.php +++ b/include/attach.php @@ -1921,6 +1921,20 @@ function file_activity($channel_id, $object, $allow_cid, $allow_gid, $deny_cid, function attach_store_item($channel, $observer, $file) { + + if(is_string($file)) { + $r = q("SELECT * FROM attach WHERE uid = %d AND hash = '%s' LIMIT 1", + intval($channel['channel_id']), + dbesc($file) + ); + + if(! $r) + return; + + $file = $r[0]; + + } + $filetype_parts = explode('/', $file['filetype']); switch($filetype_parts[0]) { -- cgit v1.2.3