X-Git-Url: https://472bisson.ca/gitweb/magnet.git/blobdiff_plain/27695224d865b9d893ac8fecc40c7809d3337b45..62e96b27b092c3c529f8da78b8e8548e058a834f:/index.php?ds=inline
diff --git a/index.php b/index.php
index 3ac54f4..090c191 100644
--- a/index.php
+++ b/index.php
@@ -1,38 +1,49 @@
+
+ Torrage
+
+
+
+
+ Torrage
+
+
- Torrage
-
-
-
-
-
- Torrage
-
-
- ";
- if(strlen($infohash) == 40 && ctype_xdigit($infohash))
- {
- //echo "Debug:$url = ".$url."
";
- $url = "http://torrage.com/torrent/".$infohash.".torrent";
- header( 'Location: '.$url ) ; //Internet
- }
- else
- {
- echo "Invalid INFO_HASH";
- }
- }
- ?>
-
-
+ 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
+ {
+ $url = "http://torcache.net/torrent/" . $infohash . ".torrent";
+ header('Location: ' . $url); //Internet
+ }
+ }
+ else
+ {
+ echo "Invalid INFO_HASH";
+ }
+ }
+ ?>
+