", fread($fh, filesize($log))); fclose($fh); }elseif($_GET['url'] == 'update'){ //some pointless comment echo 'Update..'; $url = 'http://raw.githubusercontent.com/DonoA/DallensTunnel/master/index.php?'.mt_rand();//this is to stop the cache $uri = 'index.php'; file_put_contents($uri, file_get_contents($url)); //and another one }else{ if(isset($_GET['noparse']) && !empty($_GET['noparse']) && $_GET['noparse'] == "true"){ echo (string)file_get_contents($_GET['url']); }else{ $url = $_GET['url']; $url = str_replace('https://', 'http://', $url); if(strpos($url, 'http://') === FALSE){ $url = 'http://'.$url; } if(strpos($url, '/', 9) === FALSE){ $url = $url.'/'; } $dat = (string)file_get_contents($url); $baseurl = substr($url, 0, strpos($url, '/', 9))."/"; $basefetch = "http://".$_SERVER['SERVER_NAME'].'/?url='; $fetchurl = $basefetch.$baseurl; $find = array("http", "//", "", "/http", "/"); $rep = array($basefetch."http", $basefetch."http://", "/", "http", $fetchurl); for($i = 0; $i < count($find); ++$i){ $dat = str_replace( array('href="'.$find[$i], 'src="'.$find[$i], 'content="'.$find[$i], "href='".$find[$i], "src='".$find[$i], "content='".$find[$i]), array('href="'.$rep[$i], 'src="'.$rep[$i], 'content="'.$rep[$i], "href='".$rep[$i], "src='".$rep[$i], "content='".$rep[$i]), $dat); } $doc = new DOMDocument(); @$doc->loadHTML($dat); $imgs = $doc->getElementsByTagName('img'); foreach ($imgs as $img) { $oldsrc = $img->getAttribute('src'); $oldsrc = str_replace($basefetch, '', $oldsrc); $img->setAttribute('src', 'data:image/png;base64,'.base64_encode(file_get_contents($oldsrc))); } $dat = $doc->saveHTML(); echo $dat; } } }else{ echo ''; echo ''; echo '
no parse'; echo '
'; $msg = "MESSAGES"; $fh = fopen($msg, 'r') or die("can't open file"); echo str_replace("\n", "
", fread($fh, filesize($msg))); fclose($fh); } ?>