scratch – Blame information for rev 51
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
48 | office | 1 | <?php |
2 | |||
50 | office | 3 | ########################################################################### |
4 | ## Copyright (C) Wizardry and Steamworks 2017 - License: GNU GPLv3 ## |
||
5 | ########################################################################### |
||
48 | office | 6 | |
50 | office | 7 | require_once('inc/pseudocrypt.php'); |
8 | require_once('inc/functions.php'); |
||
9 | require_once('config.php'); |
||
10 | |||
11 | if (!isset($_GET['o']) or empty($_GET['o'])) { |
||
12 | http_response_code(404); |
||
13 | return; |
||
14 | } |
||
15 | |||
16 | $file = array_shift( |
||
17 | preg_grep( |
||
18 | "/$_GET[o]/", |
||
19 | scandir($STORE_FOLDER) |
||
20 | ) |
||
21 | ); |
||
22 | |||
23 | if(!isset($file) or empty($file)) |
||
24 | return; |
||
25 | |||
51 | office | 26 | $finfo = finfo_open(FILEINFO_MIME_TYPE); |
27 | header('Content-type: '.finfo_file($finfo, $STORE_FOLDER.'/'.$file)); |
||
28 | finfo_close($finfo); |
||
29 | header('Content-length: '.filesize($STORE_FOLDER.'/'.$file)); |
||
30 | header('Content-Disposition: inline; filename="' . basename($STORE_FOLDER.'/'.$file) . '"'); |
||
31 | header('X-Sendfile: '.$STORE_FOLDER.'/'.$file); |