View Single Post
  #12  
Old 16th December 2019, 00:12
MicroMonkey's Avatar
MicroMonkey MicroMonkey is offline
Senior Member
 
Join Date: Jun 2016
P2P
Posts: 52
Default
In announce.php, functions.php, and scrape.php there are references to get_magic_quotes_gpc(), which has been dead for a long time, but everything just worked since it returned false and moved on. It seems the new php 7.4 completely dont like this reference at all, so if you remove it, this code works on 7.4 as well. Im testing this on ubuntu 18.04.3lts and apache 2.4.41
Code:
function unesc($x) {
    if (get_magic_quotes_gpc())
        return stripslashes($x);
    return $x;
}
to
Code:
function unesc($x) {
        return stripslashes($x);
    return $x;
}

and in scrape.php
Code:
foreach (explode("&", $_SERVER["QUERY_STRING"]) as $item) {
    if (preg_match("#^info_hash=(.+)\$#", $item, $m)) {
        $hash = urldecode($m[1]);

        if (get_magic_quotes_gpc())
            $info_hash = stripslashes($hash);
        else
            $info_hash = $hash;
        if (strlen($info_hash) == 20)
            $info_hash = bin2hex($info_hash);
        else if (strlen($info_hash) != 40)
            continue;
        $infohash[] = sqlesc(strtolower($info_hash));
    }
}
to
Code:
foreach (explode("&", $_SERVER["QUERY_STRING"]) as $item) {
    if (preg_match("#^info_hash=(.+)\$#", $item, $m)) {
        $hash = urldecode($m[1]);
            $info_hash = stripslashes($hash);
     //     $info_hash = $hash;
        if (strlen($info_hash) == 20)
            $info_hash = bin2hex($info_hash);
        else if (strlen($info_hash) != 40)
            continue;
        $infohash[] = sqlesc(strtolower($info_hash));
    }
}
try it and see if Its good or not. Im no expert, just trying to have fun and help out. :) If there is a better way, let me know

Last edited by MicroMonkey; 16th December 2019 at 04:46.
Reply With Quote
The Following User Says Thank You to MicroMonkey For This Useful Post:
STorrents2019 (20th February 2020)