Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

function aplGetRawDomain($url) { $raw_domain = null; if (empty($url)) { goto u..

Decoded Output download

<?  function aplGetRawDomain($url) 
{ 
  $raw_domain = null; 
  if (empty($url)) { 
    goto uDoyP; 
  } 
  $url_array = parse_url($url); 
  if (!empty($url_array["scheme"])) { 
    goto qyxuN; 
  } 
  $url = "http://" . $url; 
  $url_array = parse_url($url); 
  qyxuN: 
  if (empty($url_array["host"])) { 
    goto AxJ9I; 
  } 
  $raw_domain = $url_array["host"]; 
  $raw_domain = trim(str_ireplace("www.", '', filter_var($raw_domain, FILTER_SANITIZE_URL))); 
  AxJ9I: 
  uDoyP: 
  return $raw_domain; 
} 
function aplGetRootUrl($url, $remove_scheme, $remove_www, $remove_path, $remove_last_slash) 
{ 
  if (!filter_var($url, FILTER_VALIDATE_URL)) { 
    goto wwCaE; 
  } 
  $url_array = parse_url($url); 
  $url = str_ireplace($url_array["scheme"] . "://", '', $url); 
  if ($remove_path == 1) { 
    goto gX8Vk; 
  } 
  $last_slash_position = strripos($url, "/"); 
  if (!($last_slash_position > 0)) { 
    goto eaGMv; 
  } 
  $url = substr($url, 0, $last_slash_position + 1); 
  eaGMv: 
  goto Kihk1; 
  gX8Vk: 
  $first_slash_position = stripos($url, "/"); 
  if (!($first_slash_position > 0)) { 
    goto jlK9d; 
  } 
  $url = substr($url, 0, $first_slash_position + 1); 
  jlK9d: 
  Kihk1: 
  if (!($remove_scheme != 1)) { 
    goto SpwLr; 
  } 
  $url = $url_array["scheme"] . "://" . $url; 
  SpwLr: 
  if (!($remove_www == 1)) { 
    goto p5YLz; 
  } 
  $url = str_ireplace("www.", '', $url); 
  p5YLz: 
  if (!($remove_last_slash == 1)) { 
    goto xD3XV; 
  } 
  SAGQi: 
  if (!(substr($url, -1) == "/")) { 
    goto MCXS7; 
  } 
  $url = substr($url, 0, -1); 
  goto SAGQi; 
  MCXS7: 
  xD3XV: 
  wwCaE: 
  return trim($url); 
} 
function aplCustomPost($url, $post_info = null, $refer = null) 
{ 
  $user_agent = "phpmillion cURL"; 
  $connect_timeout = 10; 
  $server_response_array = array(); 
  $formatted_headers_array = array(); 
  if (!(filter_var($url, FILTER_VALIDATE_URL) && !empty($post_info))) { 
    goto aJVKD; 
  } 
  if (!(empty($refer) || !filter_var($refer, FILTER_VALIDATE_URL))) { 
    goto DtdQ0; 
  } 
  $refer = $url; 
  DtdQ0: 
  $ch = curl_init(); 
  curl_setopt($ch, CURLOPT_URL, $url); 
  curl_setopt($ch, CURLOPT_USERAGENT, $user_agent); 
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connect_timeout); 
  curl_setopt($ch, CURLOPT_TIMEOUT, $connect_timeout); 
  curl_setopt($ch, CURLOPT_REFERER, $refer); 
  curl_setopt($ch, CURLOPT_POST, 1); 
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post_info); 
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); 
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); 
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 
  curl_setopt($ch, CURLOPT_MAXREDIRS, 10); 
  curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$formatted_headers_array) { 
    $len = strlen($header); 
    $header = explode(":", $header, 2); 
    if (!(count($header) < 2)) { 
      goto oz6AO; 
    } 
    return $len; 
    oz6AO: 
    $name = strtolower(trim($header[0])); 
    $formatted_headers_array[$name] = trim($header[1]); 
    return $len; 
  }); 
  $result = curl_exec($ch); 
  $curl_error = curl_error($ch); 
  curl_close($ch); 
  $server_response_array["headers"] = $formatted_headers_array; 
  $server_response_array["error"] = $curl_error; 
  $server_response_array["body"] = $result; 
  aJVKD: 
  return $server_response_array; 
} ?>

Did this file decode correctly?

Original Code

function aplGetRawDomain($url)
{
  $raw_domain = null;
  if (empty($url)) {
    goto uDoyP;
  }
  $url_array = parse_url($url);
  if (!empty($url_array["\x73\x63\x68\x65\x6d\x65"])) {
    goto qyxuN;
  }
  $url = "\x68\164\164\160\72\x2f\x2f" . $url;
  $url_array = parse_url($url);
  qyxuN:
  if (empty($url_array["\150\x6f\x73\164"])) {
    goto AxJ9I;
  }
  $raw_domain = $url_array["\x68\x6f\x73\164"];
  $raw_domain = trim(str_ireplace("\x77\167\167\x2e", '', filter_var($raw_domain, FILTER_SANITIZE_URL)));
  AxJ9I:
  uDoyP:
  return $raw_domain;
}
function aplGetRootUrl($url, $remove_scheme, $remove_www, $remove_path, $remove_last_slash)
{
  if (!filter_var($url, FILTER_VALIDATE_URL)) {
    goto wwCaE;
  }
  $url_array = parse_url($url);
  $url = str_ireplace($url_array["\x73\x63\x68\x65\155\x65"] . "\x3a\57\x2f", '', $url);
  if ($remove_path == 1) {
    goto gX8Vk;
  }
  $last_slash_position = strripos($url, "\57");
  if (!($last_slash_position > 0)) {
    goto eaGMv;
  }
  $url = substr($url, 0, $last_slash_position + 1);
  eaGMv:
  goto Kihk1;
  gX8Vk:
  $first_slash_position = stripos($url, "\57");
  if (!($first_slash_position > 0)) {
    goto jlK9d;
  }
  $url = substr($url, 0, $first_slash_position + 1);
  jlK9d:
  Kihk1:
  if (!($remove_scheme != 1)) {
    goto SpwLr;
  }
  $url = $url_array["\x73\x63\150\145\x6d\145"] . "\72\x2f\57" . $url;
  SpwLr:
  if (!($remove_www == 1)) {
    goto p5YLz;
  }
  $url = str_ireplace("\167\167\x77\x2e", '', $url);
  p5YLz:
  if (!($remove_last_slash == 1)) {
    goto xD3XV;
  }
  SAGQi:
  if (!(substr($url, -1) == "\x2f")) {
    goto MCXS7;
  }
  $url = substr($url, 0, -1);
  goto SAGQi;
  MCXS7:
  xD3XV:
  wwCaE:
  return trim($url);
}
function aplCustomPost($url, $post_info = null, $refer = null)
{
  $user_agent = "\160\x68\160\155\151\154\x6c\x69\x6f\156\40\143\x55\122\114";
  $connect_timeout = 10;
  $server_response_array = array();
  $formatted_headers_array = array();
  if (!(filter_var($url, FILTER_VALIDATE_URL) && !empty($post_info))) {
    goto aJVKD;
  }
  if (!(empty($refer) || !filter_var($refer, FILTER_VALIDATE_URL))) {
    goto DtdQ0;
  }
  $refer = $url;
  DtdQ0:
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
  curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $connect_timeout);
  curl_setopt($ch, CURLOPT_TIMEOUT, $connect_timeout);
  curl_setopt($ch, CURLOPT_REFERER, $refer);
  curl_setopt($ch, CURLOPT_POST, 1);
  curl_setopt($ch, CURLOPT_POSTFIELDS, $post_info);
  curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
  curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
  curl_setopt($ch, CURLOPT_MAXREDIRS, 10);
  curl_setopt($ch, CURLOPT_HEADERFUNCTION, function ($curl, $header) use (&$formatted_headers_array) {
    $len = strlen($header);
    $header = explode("\x3a", $header, 2);
    if (!(count($header) < 2)) {
      goto oz6AO;
    }
    return $len;
    oz6AO:
    $name = strtolower(trim($header[0]));
    $formatted_headers_array[$name] = trim($header[1]);
    return $len;
  });
  $result = curl_exec($ch);
  $curl_error = curl_error($ch);
  curl_close($ch);
  $server_response_array["\x68\x65\x61\144\145\162\x73"] = $formatted_headers_array;
  $server_response_array["\x65\162\162\x6f\x72"] = $curl_error;
  $server_response_array["\142\157\144\x79"] = $result;
  aJVKD:
  return $server_response_array;
}

Function Calls

None

Variables

None

Stats

MD5 48f63d17a2c05db145f23e259d5a5905
Eval Count 0
Decode Time 37 ms