summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--index.php11
-rw-r--r--pages/chat.php3
-rw-r--r--redirect.php83
3 files changed, 95 insertions, 2 deletions
diff --git a/index.php b/index.php
index f909306..49793a0 100644
--- a/index.php
+++ b/index.php
@@ -99,8 +99,15 @@ switch ($request) {
break;
case "redirect":
- $to = $_GET['to'];
- DoRedirect("<strong>THIS URL COULD BE UNSAFE! Please confirm!</strong><br/>", $to, $duration = "8");
+ //Whitelist things?
+ if (true) {
+ require('redirect.php');
+ } else {
+ //Redirect instantly:
+ $to = $_GET['to'];
+ DoRedirect(NULL, $to, $duration = "0");
+ }
+ exit;
break;
case "hometutorial":
diff --git a/pages/chat.php b/pages/chat.php
index f2d2231..d2198c7 100644
--- a/pages/chat.php
+++ b/pages/chat.php
@@ -162,6 +162,9 @@ function chatReplaceAndEncode(chat) {
//Replace # in the URL with %23
chat = chat.replace(/<a href='redirect\?to=(.*?)(#)(.*?)' target='_blank'>/ig, "<a href='redirect?to=$1%23$3' target='_blank'>");
+ chat = chat.replace(/<a href='redirect\?to=(.*?)(&amp;)(.*?)' target='_blank'>/ig, "<a href='redirect?to=$1%26$3' target='_blank'>");
+ //Making the bet that not all browsers do the same:
+ chat = chat.replace(/<a href='redirect\?to=(.*?)(&)(.*?)' target='_blank'>/ig, "<a href='redirect?to=$1%26$3' target='_blank'>");
return chat;
}
diff --git a/redirect.php b/redirect.php
new file mode 100644
index 0000000..e010d94
--- /dev/null
+++ b/redirect.php
@@ -0,0 +1,83 @@
+<?
+$to = $_GET['to'];
+include('globe.php');
+?>
+<html>
+
+<head>
+<title>Pathery.com - Redirecting...</title>
+
+<meta http-equiv="refresh" content="6;URL=<? echo $to; ?>">
+
+<style>
+body {
+background-color: #121212;
+color:#ddd
+}
+
+.update {
+ background-color: #222229;
+ margin:0 auto;
+ margin-top: 200px;
+ width:400px;
+ border: 0px outset #aaa;
+ padding: 10px;
+ border-radius: 25px;
+}
+h3 {
+ text-align: center;
+}
+
+.buttons a {
+ margin: 10px;
+ opacity: 0.7;
+ filter: alpha(opacity=70);
+}
+.buttons a:hover {
+ opacity: 1;
+ filter: alpha(opacity=100);
+}
+
+a {
+ text-decoration: underline;
+ color: #aaaa99;
+}
+a:hover {
+ text-decoration: underline;
+ color: #FFFFFF;
+}
+</style>
+
+<script>
+
+var timeLeft = 5;
+var countdownRedirectInt = self.setInterval(countdownRedirect, 1000);
+
+function countdownRedirect() {
+ if (timeLeft <= 0) {
+ return;
+ }
+ timeLeft--;
+ var handle = document.getElementById("redirectTitle")
+ handle.innerHTML = 'You are being redirected in '+timeLeft+' seconds';
+
+ if (timeLeft <= 0) {
+ window.location = "<? echo $to; ?>";
+ }
+}
+// http://www.mazetd.4xg.net/redirect?to=http://www.mazetd.4xg.net/redirect?to=http://www.youtube.com/watch?v=FCSBoOcGFFE
+</script>
+
+</head>
+<body>
+
+<div class='update'>
+<h3 id='redirectTitle'>You are being redirected in 5 seconds</h3>
+<p>Let's go!: <a href='<? echo $to; ?>'><? echo $to; ?></a></p>
+
+<p>Back to: <a href='<? echo $mydomain; ?>' title='Go back'><? echo $mydomain; ?></a>
+</p>
+</div>
+
+</body>
+</html> \ No newline at end of file