forked from TOMMMMMMMMMC/GreatPosterWall
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gazelle.php
93 lines (89 loc) · 2.26 KB
/
gazelle.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
$Redirects = [
'browse' => 'torrents.php',
'collage' => 'collages.php',
'signup' => 'register.php',
'whitelist' => 'rules.php?p=clients',
'forum' => 'forums.php',
'randomcollage' => 'random.php?action=collage'
];
$PathInfo = pathinfo($_SERVER['SCRIPT_NAME']);
$Document = $PathInfo['filename'];
if ($PathInfo['dirname'] !== '/') {
header("Location: /index.php");
} elseif (isset($Redirects[$Document])) {
$Seperator = (strpos($Redirects[$Document], "?") === false) ? "?" : "&";
$Rest = (!empty($_SERVER['QUERY_STRING'])) ? $Seperator . $_SERVER['QUERY_STRING'] : "";
header("Location: {$Redirects[$Document]}{$Rest}");
} elseif (in_array($Document, ['announce', 'scrape'])) {
echo "d14:failure reason40:Invalid .torrent, try downloading again.e";
die();
}
$Valid = false;
switch ($Document) {
case 'tg':
case 'peerupdate':
/** @noinspection PhpMissingBreakStatementInspection */
case 'schedule':
define('MEMORY_EXCEPTION', true);
define('TIME_EXCEPTION', true);
case 'artist':
case 'bookmarks':
case 'collages':
case 'comments':
case 'forums':
case 'friends':
case 'torrents':
case 'upload':
case 'user':
case 'userhistory':
/** @noinspection PhpMissingBreakStatementInspection */
case 'wiki':
define('ERROR_EXCEPTION', true);
case 'ajax':
case 'apply':
case 'blog':
case 'bonus':
case 'captcha':
case 'chat':
case 'contest':
case 'donate':
case 'enable':
case 'error':
case 'inbox':
case 'index':
case 'irc':
case 'locked':
case 'log':
case 'logchecker':
case 'login':
case 'logout':
case 'questions':
case 'random':
case 'referral':
case 'register':
case 'reports':
case 'reportsv2':
case 'requests':
case 'rules':
case 'signup':
case 'sitehistory':
case 'staff':
case 'staffblog':
case 'staffpm':
case 'stats':
case 'top10':
case 'activity':
case 'badges':
case 'ssp':
case 'shifu':
case 'subtitles':
$Valid = true;
break;
}
if (!$Valid) {
$_SERVER['SCRIPT_NAME'] = 'error.php';
$_SERVER['SCRIPT_FILENAME'] = 'error.php';
$Error = 404;
}
require('classes/script_start.php');