Gets an URL and converts it to standard format (eg. ftp.somewhere.org - ftp://ftp.somewhere.org/). It can distinguish ftp scheme, when the hostname starts with 'ftp'.
Download
View Source (print view)
Rating : 4.7
Views : 431
function urlcheck($url) {
$charset = "abcdefghijklmnopqrstuvwxyz"
."ABCDEFGHIJKLMNOPQRSTUVWXYZ"
."0123456789"
."./%_-~:@?#&=";
if (!isset($url) || !is_string($url)
|| !($len = strlen($url)) || strspn($url, $charset)!=$len)
return false;
$URL = parse_url($url);
if (strlen($URL["port"]))
$port = ":".$URL["port"];
else
$port = "";
if (!strlen($URL["user"]))
$user = "";
elseif (strlen($URL["pass"]))
$user = $URL["user"].":".$URL["pass"]."@";
else
$user = $URL["user"]."@";
if (strlen($URL["host"]))
$host = $URL["host"];
else {
$host = $URL["path"];
$URL["path"] = "";
}
if (strlen($URL["path"]))
$path = $URL["path"];
else
$path = "/";
if (strlen($URL["scheme"]))
$scheme = $URL["scheme"];
elseif (substr($host, 0, 3) == "ftp")
$scheme = "ftp";
else
$scheme = "http";
$query = $URL["query"].$URL["fragment"];
return "$scheme://$user$host$port$path$query";
}
files, php script" class="neww" target="_b... and 0=1 union select, php tools and 0=1 union select, rtttl, read mysql field, security, snnap_ss, salars77, paper_without_wood, guest, enfactuation, rent a car, download, regirstration form, php_snips, fedex, call php', userstatusinonline, php_script"_class="neww"_target="_blank"_title="im_neuen, best ide, php script" class="neww" target="_b...