fix mod filestorage and fetch the info from attach if only the hash is provided in attach_store_item()

This commit is contained in:
Mario
2020-04-25 09:15:20 +00:00
parent e2b10f52e0
commit c229f058b4
2 changed files with 18 additions and 4 deletions

View File

@@ -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]) {