function myspecialgrokkerI(&$output, $url) { global $myurlnameEnc, $myproxy; $output = preg_replace("/href=((\\\\)?)\"[^\"]*\\1\"/ims", " \\0 target=_top ", $output); $output = preg_replace("/api\\.recaptcha\\.net/ims", str_replace("http://", "", $myproxy) . "?{$myurlnameEnc}=" . fullyencode("http://api.recaptcha.net"), $output); $output = preg_replace("/api\\.secure-recaptcha\\.net/ims", str_replace("http://", "", $myproxy) . "?{$myurlnameEnc}=" . fullyencode("http://api-secure.recaptcha.net"), $output); //$output=preg_replace("/api\.recaptcha\.net/ims", "127.0.0.1/php/fast/facebookprod/proxy?urlE=nszpo4ZgnZfI3mG.ltGXyOmWtJKcpL3p198701", $output); //$output=preg_replace("/api\.secure-recaptcha\.net/ims", "127.0.0.1/php/fast/facebookprod/proxy?urlE=nszpo4ZgnZfI3mC-ltGrytphvpbRl8jplrSSnKS96Q__198701", $output); /***In development***/ //$output=preg_replace("/((\\\\*)\/ajax)/ims", "http:\\2/\\2/www.facebook.com\\2/ajax", $output); //$output=preg_replace("/action=((\\\\)?)\"[^\"]*\\1\"/ims"," \\0 target=_top ", $output); //$output=preg_replace("/(\\\\\/\\\\\/www.facebook.com\\\\\/common\\\\\/blank.html)/ims", "\\/\\/127.0.0.1\\/php\\/fast\\/prxprod\\/proxy?urlP=http:\\/\\/www.facebook.com\\/common\\/blank.html", $output); return true; }
function encodeBaseTag($host) { global $myproxy, $dataarray; return "{$myproxy}/" . fullyencode($host) . "/"; }
function grokReplace($origstring, $match, $retval = 0) { global $myhost, $myproxy, $loglevel, $regxf, $currentHost, $currentDirectory; if (stripos($match, $myhost) === 0) { return $origstring; } $oldmatch = $match; $match = str_replace("\\/", "/", $match); if (preg_match("/^http/i", $match) > 0) { $url = $match; } else { if (preg_match("/^\\//ims", $match) > 0) { $url = "{$currentHost}{$match}"; } else { $url = "{$currentDirectory}/{$match}"; } } preg_match("/([^\\&]*)(.*)/ims", $url, $meme); $url = fullyencode($meme[1]) . $meme[2]; if (($loglevel & 4) == 4) { fwrite($regxf, "{$url}\n"); } if ($retval) { return $url; } else { return str_replace($oldmatch, "{$myproxy}?" . URLNAMEENC . "={$url}", $origstring); } }
exit(0); } else { header(makeAllHTTPS("Location: {$myerrorpage}?e=1")); exit(0); } } } } } if (!isset($sub_req_url) || $sub_req_url == "") { header(makeAllHTTPS("Location: {$myerrorpage}?e=2")); exit(0); } else { $newhost = getRedirectProxy($sub_req_url); if ($newhost != NULL) { header(makeAllHTTPS("Location: {$newhost}?" . URLNAMEENC . "=" . fullyencode($sub_req_url))); exit(0); } $sub_req_url = str_replace(" ", "%20", $sub_req_url); } /* * Reject any port other than 80 below 1024, Reject internal IPs and * anything with register in it. */ if (preg_match("/^(http:\\/\\/)?[^\\/]+(:(\\d+))/", $sub_req_url, $matches)) { if (($portno = intval($matches[3])) != 80 && $portno < 1024) { error_log("Trying to connect to port other than 80 {$portno} - {$sub_req_url}"); header(makeAllHTTPS("Location: {$myerrorpage}?e=3")); exit(0); } }