Skip to content

Commit

Permalink
Excluded colon from domain field validation
Browse files Browse the repository at this point in the history
  • Loading branch information
prij authored and wilr committed Sep 11, 2017
1 parent 784c3fc commit 32385e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Forms/WildcardDomainField.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function validate($validator)
*/
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()
Expand Down
7 changes: 5 additions & 2 deletions tests/php/WildcardDomainFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,9 @@ public function validDomains()
['domain7'],
['mysite.co.n-z'],
['subdomain.my-site.com'],
['subdomain.mysite']
['subdomain.mysite'],
['subdomain.mysite.com:80'],
['mysite:80']
];
}

Expand All @@ -70,7 +72,8 @@ public function invalidDomains()
['.mysite.*'],
['mys..ite.*'],
['*.mysite-'],
['*.mysite.']
['*.mysite.'],
[':1234']
];
}

Expand Down

0 comments on commit 32385e5

Please sign in to comment.