function prevent_open_redirect($url, $approved_domains){
$url = normalizer_normalize ($url);
$parse = parse_url($url);
if (!in_array($parse['host'], $approved_domains))
{
die("Disallowed URL");
}else{echo "GOOD URL";}
return $url;
}
$approved_domains = array ("yehg.net", "seckb.yehg.net");
prevent_open_redirect("https://secyehg.net/", $approved_domains);
prevent_open_redirect("https://yehg.net.attacker.in/", $approved_domains);
prevent_open_redirect("https://yehg.net%00attacker.in/", $approved_domains);