aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/attach.php9
-rw-r--r--mod/filestorage.php4
2 files changed, 10 insertions, 3 deletions
diff --git a/mod/attach.php b/mod/attach.php
index a5f9d1a6b..8676baa58 100644
--- a/mod/attach.php
+++ b/mod/attach.php
@@ -19,8 +19,13 @@ function attach_init(&$a) {
header('Content-type: ' . $r['data']['filetype']);
header('Content-disposition: attachment; filename=' . $r['data']['filename']);
- if($r['data']['flags'] & ATTACH_FLAG_OS )
- echo @file_get_contents($r['data']['data']);
+ if($r['data']['flags'] & ATTACH_FLAG_OS ) {
+ $stream = fopen($r['data']['data'],'rb');
+ if($stream) {
+ pipe_stream($stream,STDOUT);
+ fclose($stream);
+ }
+ }
else
echo $r['data']['data'];
killme();
diff --git a/mod/filestorage.php b/mod/filestorage.php
index 152b449c2..1063de256 100644
--- a/mod/filestorage.php
+++ b/mod/filestorage.php
@@ -137,7 +137,9 @@ function filestorage_content(&$a) {
'id' => $rr['id'],
'download' => $rr['hash'],
'title' => $rr['filename'],
- 'size' => $rr['filesize']
+ 'size' => $rr['filesize'],
+ 'rev' => $rr['revision']
+
);
}
}