aboutsummaryrefslogtreecommitdiffstats
path: root/mod
diff options
context:
space:
mode:
Diffstat (limited to 'mod')
-rw-r--r--mod/attach.php10
-rw-r--r--mod/item.php11
2 files changed, 15 insertions, 6 deletions
diff --git a/mod/attach.php b/mod/attach.php
index 7371f0367..c52966ce0 100644
--- a/mod/attach.php
+++ b/mod/attach.php
@@ -27,10 +27,12 @@ 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 ) {
- $stream = fopen('store/' . $c[0]['channel_address'] . '/' . $r['data']['data'],'rb');
- if($stream) {
- pipe_stream($stream,STDOUT);
- fclose($stream);
+ $istream = fopen('store/' . $c[0]['channel_address'] . '/' . $r['data']['data'],'rb');
+ $ostream = fopen('php://output','wb');
+ if($istream && $ostream) {
+ pipe_streams($istream,$ostream);
+ fclose($istream);
+ fclose($ostream);
}
}
else
diff --git a/mod/item.php b/mod/item.php
index 915bed706..23fce2fd7 100644
--- a/mod/item.php
+++ b/mod/item.php
@@ -276,6 +276,9 @@ function item_post(&$a) {
$item_restrict = $orig_post['item_restrict'];
$postopts = $orig_post['postopts'];
$created = $orig_post['created'];
+ $mid = $orig_post['mid'];
+ $parent_mid = $orig_post['parent_mid'];
+ $plink = $orig_post['plink'];
}
else {
@@ -592,9 +595,13 @@ function item_post(&$a) {
$notify_type = (($parent) ? 'comment-new' : 'wall-new' );
- $mid = (($message_id) ? $message_id : item_message_id());
+ if(! $mid) {
+ $mid = (($message_id) ? $message_id : item_message_id());
+ }
+ if(! $parent_mid) {
+ $parent_mid = $mid;
+ }
- $parent_mid = $mid;
if($parent_item)
$parent_mid = $parent_item['mid'];