relative attachment not fetched due to os filename issue

This commit is contained in:
redmatrix 2015-11-08 13:54:31 -08:00
parent 1874346c46
commit cf0bff8582
2 changed files with 5 additions and 2 deletions

View File

@ -37,7 +37,10 @@ function attach_init(&$a) {
header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"'); header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"');
if(intval($r['data']['os_storage'])) { if(intval($r['data']['os_storage'])) {
$fname = dbunescbin($r['data']['data']); $fname = dbunescbin($r['data']['data']);
$istream = fopen('store/' . $c[0]['channel_address'] . '/' . $fname,'rb'); if(strpos($fname,'store') !== false)
$istream = fopen($fname,'rb');
else
$istream = fopen('store/' . $c[0]['channel_address'] . '/' . $fname,'rb');
$ostream = fopen('php://output','wb'); $ostream = fopen('php://output','wb');
if($istream && $ostream) { if($istream && $ostream) {
pipe_streams($istream,$ostream); pipe_streams($istream,$ostream);

View File

@ -1 +1 @@
2015-11-06.1208 2015-11-08.1210