- fixed regex for domains to allow a port and/or subfolders/files, fixes #431

This commit is contained in:
Michael Kaufmann (d00p)
2010-10-25 06:45:15 +00:00
parent ffe49e8acd
commit 44b53ffd2c

View File

@@ -39,7 +39,7 @@ function validateUrl($url)
// needs converting // needs converting
$url = $idna_convert->encode($url); $url = $idna_convert->encode($url);
$pattern = "/^https?:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,4}(\/\S*)?$/i"; $pattern = "/^https?:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,4}(\:[0-9]+)?\/?(.+)?$/i";
if(preg_match($pattern, $url)) if(preg_match($pattern, $url))
{ {
return true; return true;