mirror of
https://github.com/silverstripe/silverstripe-subsites
synced 2024-10-22 11:05:55 +02:00
Excluded colon from domain field validation
This commit is contained in:
parent
784c3fca5e
commit
32385e580d
@ -36,7 +36,7 @@ class WildcardDomainField extends TextField
|
||||
*/
|
||||
public function checkHostname($hostname)
|
||||
{
|
||||
return (bool)preg_match('/^([a-z0-9\*]+[\-\.])*([a-z0-9\*]+)$/', $hostname);
|
||||
return (bool)preg_match('/^([a-z0-9\*]+[\-\.\:])*([a-z0-9\*]+)$/', $hostname);
|
||||
}
|
||||
|
||||
public function Type()
|
||||
|
@ -54,7 +54,9 @@ class WildcardDomainFieldTest extends SapphireTest
|
||||
['domain7'],
|
||||
['mysite.co.n-z'],
|
||||
['subdomain.my-site.com'],
|
||||
['subdomain.mysite']
|
||||
['subdomain.mysite'],
|
||||
['subdomain.mysite.com:80'],
|
||||
['mysite:80']
|
||||
];
|
||||
}
|
||||
|
||||
@ -70,7 +72,8 @@ class WildcardDomainFieldTest extends SapphireTest
|
||||
['.mysite.*'],
|
||||
['mys..ite.*'],
|
||||
['*.mysite-'],
|
||||
['*.mysite.']
|
||||
['*.mysite.'],
|
||||
[':1234']
|
||||
];
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user