]> 472bisson.ca Git - magnet.git/commitdiff
Code changes
authorManjunath CV <cvmanjoo@gmail.com>
Thu, 26 Dec 2013 17:03:01 +0000 (22:33 +0530)
committerManjunath CV <cvmanjoo@gmail.com>
Thu, 26 Dec 2013 17:03:01 +0000 (22:33 +0530)
.gitignore
index.php

index 14bc68c7cc2ac75f3ade400869623729943f03ae..b69939577d8340d48b60d38d4566e2e08ae59fd0 100644 (file)
@@ -1 +1,2 @@
-/nbproject/private/
\ No newline at end of file
+/nbproject/private/\r
+/nbproject/
\ No newline at end of file
index 3ac54f4a4b68717411b279f604ee94c4ca8fa3bb..2dad933457d659db76db0dd3c569169c87b7e243 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,38 +1,33 @@
 <!DOCTYPE html>\r
 <html>\r
-\r
        <head>\r
                <title>Torrage</title>\r
                <meta content="text/html; charset=utf-8" http-equiv="Content-Type">\r
                <link href="style.css" rel="stylesheet" type="text/css" />\r
        </head>\r
-       \r
        <body>\r
                <h1>Torrage</h1>\r
                <form action="index.php" method="get">\r
                        <input type="text" name="infohash"/>\r
                        <input type="submit" value="Get .torrent"/>\r
-               </form>\r
-               \r
-               <?php \r
-               \r
-               //http://torrage.com/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent\r
-               if(isset($_GET["infohash"]))\r
-               {\r
-                       $infohash = $_GET['infohash'];\r
-                       //echo "Debug:IF -- ".$_GET["infohash"]."<br /> ";\r
-                       if(strlen($infohash) == 40 && ctype_xdigit($infohash))\r
-                       {\r
+               </form>         \r
+               <?php  //http://torrage.com/torrent/640FE84C613C17F663551D218689A64E8AEBEABE.torrent\r
+                \r
+                if (filter_has_var(INPUT_GET, 'infohash'))\r
+                {\r
+                    $infohash = filter_input(INPUT_GET, 'infohash');\r
+                \r
+                    if(strlen($infohash) == 40 && ctype_xdigit($infohash))\r
+                    {\r
                                //echo "Debug:$url = ".$url."<br />";\r
                                $url = "http://torrage.com/torrent/".$infohash.".torrent";\r
                                header( 'Location: '.$url ) ;  //Internet \r
-                       }\r
-                       else\r
-                       {\r
-                               echo "<a>Invalid INFO_HASH</a>";        \r
-                       }\r
+                    }\r
+                    else\r
+                    {\r
+                        echo "<a>Invalid INFO_HASH</a>";       \r
+                    }\r
                }\r
                ?>\r
        </body>\r
-\r
 </html>                                                                                                           
\ No newline at end of file