function LocalRedirect($url) { global $HTTP_HOST, $SERVER_PORT; $url = str_replace("&", "&", $url); $url = str_replace("\r", "", $url); $url = str_replace("\n", "", $url); BXInstallServices::SetStatus("302 Found"); if (strtolower(substr($url, 0, 7)) == "http://" || strtolower(substr($url, 0, 8)) == "https://" || strtolower(substr($url, 0, 6)) == "ftp://") { header("Request-URI: {$url}"); header("Content-Location: {$url}"); header("Location: {$url}"); } else { if ($SERVER_PORT != "80" && $SERVER_PORT != 443 && $SERVER_PORT > 0 && strpos($HTTP_HOST, ":" . $SERVER_PORT) <= 0) { $HTTP_HOST .= ":" . $SERVER_PORT; } $protocol = $_SERVER["SERVER_PORT"] == 443 || strtolower($_SERVER["HTTPS"]) == "on" ? "https" : "http"; header("Request-URI: {$protocol}://{$HTTP_HOST}{$url}"); header("Content-Location: {$protocol}://{$HTTP_HOST}{$url}"); header("Location: {$protocol}://{$HTTP_HOST}{$url}"); } exit; }