scratch – Blame information for rev 50
?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 | |||
26 | header("Content-type: ".mime_content_type($STORE_FOLDER.'/'.$file)); |
||
27 | header('Expires: 0'); |
||
28 | header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
||
29 | header('Pragma: public'); |
||
30 | |||
31 | echo atomized_get_contents($STORE_FOLDER.'/'.$file); |