aboutsummaryrefslogtreecommitdiffstats
path: root/mod/attach.php
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-18 20:38:38 -0700
committerredmatrix <git@macgirvin.com>2016-04-18 20:38:38 -0700
commit2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289 (patch)
tree2376d950ba2bdc7753336a3e2b94865c95c238f2 /mod/attach.php
parent2a61817bad96526994c0499f1fc0a843a9cc9405 (diff)
downloadvolse-hubzilla-2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289.tar.gz
volse-hubzilla-2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289.tar.bz2
volse-hubzilla-2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289.zip
module updates
Diffstat (limited to 'mod/attach.php')
-rw-r--r--mod/attach.php55
1 files changed, 0 insertions, 55 deletions
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 @@
-<?php
-
-require_once('include/security.php');
-require_once('include/attach.php');
-
-function attach_init(&$a) {
-
- if(argc() < 2) {
- notice( t('Item not available.') . EOL);
- return;
- }
-
- $r = attach_by_hash(argv(1),((argc() > 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();
-
-}