-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
47 lines (43 loc) · 2.46 KB
/
index.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
<?php
$website = "";
$current_url = $_SERVER['REQUEST_URI'];
$url_components = parse_url($current_url);
if (isset($url_components['query'])) {
parse_str($url_components['query'], $query_params);
if (isset($query_params['url'])) {
$website = $query_params['url'];
}
}
$website = filter_var($website, FILTER_SANITIZE_URL);
$website_host = parse_url($website, PHP_URL_HOST);
//Domain blocking. Only include the domain. (e.g. example.com NOT https://example.com)
$blocklist = [" "];
//URL blocking. http://example.com/test and https://example.com/test are seen as different URLs.
$blockurl = [""];
//Skiplist. (have the jump script immediately redirect to domains listed here ) Only include the domain, not https://.
$skiplist = ["world2ch.net"];
//NoAutoList. Prevent the jump script from automatically jumping to certain domains. Only include the domain.
$noautolist = [" "];
if ($website == NULL) {
die("No Link Specified");
}
elseif (strpos($website, "https://") !== 0 && strpos($website, "http://") !== 0 && strpos($website, "mailto:") !== 0) {
echo("Invalid URL");
die();
}
elseif (in_array(strtolower($website_host), array_map('strtolower', $skiplist))) {
die("Quickly jumping to the following link: <a href='" . htmlspecialchars($website, ENT_QUOTES) . "'>" . htmlspecialchars($website, ENT_QUOTES) . "</a><meta http-equiv='refresh' content='0; URL=$website'>");
}
elseif (in_array(strtolower($website_host), array_map('strtolower', $blocklist))) {
die("Sorry, the domain you are attempting to jump to is blocked.");
}
elseif (in_array(strtolower($website), array_map('strtolower', $blockurl))) {
die("Sorry, the URL you are attempting to jump to is blocked.");
}
elseif (in_array(strtolower($website_host), array_map('strtolower', $noautolist))) {
die("Jumping to the following link: <a href='" . htmlspecialchars($website, ENT_QUOTES) . "'>" . htmlspecialchars($website, ENT_QUOTES) . "</a><br><br><font color=red>This domain may contain questionable content. Click the URL to continue.</font><br><hr><a href='https://github.com/RealAngeleno/JumpZero'>JumpZero</a>");
}
echo("Jumping to the following link: <a href='" . htmlspecialchars($website, ENT_QUOTES) . "'>" . htmlspecialchars($website, ENT_QUOTES) . "</a><br><br>You will automatically be redirected in 5 seconds...");
//Auto redirect to whatever site.
echo("<meta http-equiv='refresh' content='5; URL=$website'>");
echo("<hr><a href='https://github.com/RealAngeleno/JumpZero'>JumpZero</a>");