From 2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 18 Apr 2016 20:38:38 -0700 Subject: module updates --- mod/attach.php | 55 ------------------------------------------------------- 1 file changed, 55 deletions(-) delete mode 100644 mod/attach.php (limited to 'mod/attach.php') diff --git a/mod/attach.php b/mod/attach.php deleted file mode 100644 index 306e39519..000000000 --- a/mod/attach.php +++ /dev/null @@ -1,55 +0,0 @@ - 2) ? intval(argv(2)) : 0)); - - if(! $r['success']) { - notice( $r['message'] . EOL); - return; - } - - $c = q("select channel_address from channel where channel_id = %d limit 1", - intval($r['data']['uid']) - ); - - if(! $c) - return; - - - $unsafe_types = array('text/html','text/css','application/javascript'); - - if(in_array($r['data']['filetype'],$unsafe_types)) { - header('Content-type: text/plain'); - } - else { - header('Content-type: ' . $r['data']['filetype']); - } - - header('Content-disposition: attachment; filename="' . $r['data']['filename'] . '"'); - if(intval($r['data']['os_storage'])) { - $fname = dbunescbin($r['data']['data']); - 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); - fclose($istream); - fclose($ostream); - } - } - else - echo dbunescbin($r['data']['data']); - killme(); - -} -- cgit v1.2.3