From 2a4e8972e0edfa3156d9ce54d68ce0e54c0ec289 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Mon, 18 Apr 2016 20:38:38 -0700 Subject: module updates --- mod/getfile.php | 97 --------------------------------------------------------- 1 file changed, 97 deletions(-) delete mode 100644 mod/getfile.php (limited to 'mod/getfile.php') diff --git a/mod/getfile.php b/mod/getfile.php deleted file mode 100644 index c0916de79..000000000 --- a/mod/getfile.php +++ /dev/null @@ -1,97 +0,0 @@ - $d1) || ($time < $d2)) { - logger('time outside allowable range'); - killme(); - } - - if(! rsa_verify($hash . '.' . $time,base64url_decode($sig),$channel['channel_pubkey'])) { - logger('verify failed.'); - killme(); - } - - - $r = attach_by_hash($resource,$revision); - - if(! $r['success']) { - notice( $r['message'] . EOL); - 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/' . $channel['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(); - - - -} \ No newline at end of file -- cgit v1.2.3