X-Git-Url: https://472bisson.ca/gitweb/magnet.git/blobdiff_plain/9ab9ae27d681b5a0e6e945a78eae0a08df98b575..77442f2de0fc311d8f41bf64b19b7f50936072eb:/index.php
diff --git a/index.php b/index.php
index e7c0591..3d30be8 100644
--- a/index.php
+++ b/index.php
@@ -1,45 +1,57 @@
+
+ Torrage
+
+
+
+
+ Torrage
+
+
-
- Torrage
-
-
-
- Torrage
-
-
- ";
-
- $url = "http://torrage.com/torrent/".$infohash.".torrent";
-
- echo $url;
-
- header( 'Location: '.$url ) ; //Internet
-
- }
-
-
-
-
- ?>
-
-
+ if (filter_has_var(INPUT_GET, 'infohash') && filter_has_var(INPUT_GET, 'site'))
+ {
+ $infohash = filter_input(INPUT_GET, 'infohash');
+ $site = filter_input(INPUT_GET, 'site');
+ if (strlen($infohash) == 40 && ctype_xdigit($infohash))
+ {
+ $infohash = strtoupper($infohash);
+ //echo "Debug:$url = ".$url."
";
+ if ($site == 'torrage')
+ {
+ $url = "http://torrage.com/torrent/" . $infohash . ".torrent";
+ header('Location: ' . $url); //Internet
+ }
+ else if ($site == 'torcache')
+ {
+ $url = "http://torcache.net/torrent/" . $infohash . ".torrent";
+ header('Location: ' . $url); //Internet
+ }
+ else
+ {
+ $url = "http://zoink.it/torrent/" . $infohash . ".torrent";
+ header('Location: ' . $url); //Internet
+ }
+ }
+ else
+ {
+ echo "Invalid INFO_HASH";
+ }
+ }
+ ?>
+
+