. * * surf.php * * The surfing page. * * @author Daniele Bonini * @copyrights (c) 2016, 2024, 5 Mode */ require("config.inc"); echo("
 LIGHTOFF  (on github)


"); $url = filter_input(INPUT_GET, "url", FILTER_SANITIZE_STRING); //echo($url."
"); if (substr($url, 0, 4) === "http") { $ipos = stripos($url, "/", 8); if ($ipos) { $domain = substr($url, 0, $ipos); } else { $domain = $url; } } else { $domain = stripos($url, "/"); if ($ipos) { $domain = "http://" . substr($url, 0, $ipos); } else { $domain = "http://" . $url; } } //echo($domain."
"); $file = fopen($url, "r"); if (!$file) { echo "

404 LightOff url doesn't exist.

\n"; exit; } $w = ""; while (!feof($file)) { $w .= fgets($file, 20000); } fclose($file); $ipos = stripos($w, ""); $head = substr($w, 0, $ipos + 7); $body = substr($w, $ipos + 7); $head = str_ireplace("", "\n\n\n\n", $head); if (mb_stripos($head, "", "\n", $head); } $head = str_ireplace('src="//', 'src="https://', $head); $head = str_ireplace('src="/', 'src="'.$domain.'/', $head); $head = preg_replace('/src="(.{6}(?/iU", "$0\n
\n

  LIGHTOFF
", $body); //$body = str_ireplace("", " 
\n\n
\n\n
\n\n\n\n", $body); $body = str_ireplace("", "\n\n\n\n", $body); $body = str_ireplace('src="//', 'src="https://', $body); $body = str_ireplace('src="/', 'src="'.$domain.'/', $body); $body = preg_replace('/src="(.{6}(?