From cf0bff8582e7b70a4931e3c510cd0018e0b5ec6c Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 8 Nov 2015 13:54:31 -0800 Subject: relative attachment not fetched due to os filename issue --- mod/attach.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'mod/attach.php') diff --git a/mod/attach.php b/mod/attach.php index ad5dead07..306e39519 100644 --- a/mod/attach.php +++ b/mod/attach.php @@ -37,7 +37,10 @@ function attach_init(&$a) { header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"'); if(intval($r['data']['os_storage'])) { $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'); if($istream && $ostream) { pipe_streams($istream,$ostream); -- cgit v1.2.3