- fixed regex for domains to allow a port and/or subfolders/files, fixes #431
This commit is contained in:
@@ -39,7 +39,7 @@ function validateUrl($url)
|
||||
// needs converting
|
||||
$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))
|
||||
{
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user