fix regex to add domains when using php-5.2.13 or php-5.3.2, thx to felauten

This commit is contained in:
Michael Kaufmann (d00p)
2010-04-20 21:35:30 +00:00
parent 24efe70335
commit b87e4277f2

View File

@@ -43,7 +43,7 @@ function validateDomain($domainname)
if(version_compare("5.2.13", PHP_VERSION, "=")
|| version_compare("5.3.2", PHP_VERSION, "="))
{
$pattern = '/^([a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?\.)+[a-z]{2,6}$/i';
$pattern = '/^http:\/\/([a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?\.)+[a-z]{2,6}$/i';
if(preg_match($pattern, $domainname_tmp))
{
return $domainname;