-
Notifications
You must be signed in to change notification settings - Fork 58
/
view.php
37 lines (32 loc) · 959 Bytes
/
view.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
$nosession=true;
$nosecu=true;
include("./includes/common.php");
$urlarr=explode('/',$_SERVER['PATH_INFO']);
if (($length = count($urlarr)) > 1) {
$url = $urlarr[$length-1];
}
$extension=explode('&',$url);
if (($length = count($extension)) > 1) {
$pwd = $extension[$length-1];
$url = $extension[0];
}
if(strpos($url,".")){
$hash=substr($url,0,strpos($url,"."));
}else{
$hash=$url;
}
$row = $DB->getRow("SELECT * FROM `pre_file` WHERE `hash`=:hash limit 1", [':hash'=>$hash]);
if(!$row) exit;
if($row['block']>=1){
header("Content-type: ".minetype('gif'));
readfile(ROOT.'assets/img/block.gif');
exit;
}
if ($stor->exists($row['hash'])) {
if(is_view($row['type']))
{
$DB->exec("UPDATE `pre_file` SET `lasttime`=NOW(),`count`=`count`+1 WHERE `id`='{$row['id']}'");
file_output($hash, $row['type'], $row['size'], $row['name'], true, isset($_GET['greencheck']));
}
}