Merge branch 'cherry-pick-4cfb9658' into 'dev'

fix duplicate attachment and regression with audio file upload

See merge request hubzilla/core!1766
This commit is contained in:
M. Dent 2019-11-04 20:01:14 +01:00
commit aa137fb2d2
2 changed files with 2 additions and 7 deletions

View File

@ -817,11 +817,6 @@ class Item extends Controller {
'revision' => $r['data']['revision']
);
}
$ext = substr($r['data']['filename'],strrpos($r['data']['filename'],'.'));
if(strpos($r['data']['filetype'],'audio/') !== false)
$attach_link = '[audio]' . z_root() . '/attach/' . $r['data']['hash'] . '/' . $r['data']['revision'] . (($ext) ? $ext : '') . '[/audio]';
elseif(strpos($r['data']['filetype'],'video/') !== false)
$attach_link = '[video]' . z_root() . '/attach/' . $r['data']['hash'] . '/' . $r['data']['revision'] . (($ext) ? $ext : '') . '[/video]';
$body = str_replace($match[1][$i],$attach_link,$body);
$i++;
}

View File

@ -111,7 +111,7 @@ class Wall_attach extends \Zotlabs\Web\Controller {
}
if(strpos($r['data']['filetype'],'audio') === 0) {
$url = z_root() . '/cloud/' . $channel['channel_address'] . '/' . $r['data']['display_path'];
echo "\n\n" . '[zaudio]' . $url . '[/zaudio]' . "\n\n";
$s = "\n\n" . '[zaudio]' . $url . '[/zaudio]' . "\n\n";
}
$s .= "\n\n" . '[attachment]' . $r['data']['hash'] . ',' . $r['data']['revision'] . '[/attachment]' . "\n";