Merge pull request #103 from misdoro/master

fix regex-pattern in validateDomain to allow IDN TLDs (punycode), fixes #640
This commit is contained in:
Michael Kaufmann
2013-08-25 22:49:41 -07:00

View File

@@ -42,7 +42,7 @@ function validateDomain($domainname)
// a dash (-) in it. As the PHP_VERSION constant
// gives also patch-brandings, e.g. '5.3.2-pl0-gentoo'
// we just always use our regex
$pattern = '/^http:\/\/([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-z0-9\-]{2,8}$/i';
if(preg_match($pattern, $domainname_tmp))
{
return $domainname;