diff options
author | Guillaume Mazoyer <respawneral@gmail.com> | 2014-05-30 00:45:37 +0200 |
---|---|---|
committer | Guillaume Mazoyer <respawneral@gmail.com> | 2014-05-30 00:45:37 +0200 |
commit | 0d8a305d61aacaa0ee94374d3a26b531be28a09c (patch) | |
tree | 944352e116024c05024635c51fb34a845c5e9602 /utils.php | |
parent | ac14313e199cb01191768306bc5c14ac101f5814 (diff) |
Update regex for matching FQDN.
Diffstat (limited to 'utils.php')
-rw-r--r-- | utils.php | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -28,7 +28,7 @@ function match_ipv6($ip) { } function match_fqdn($fqdn) { - $regex = '/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/'; + $regex = '/(?=^.{4,255}$)(^((?!-)[a-zA-Z0-9-]{1,63}(?<!-)\.)+[a-zA-Z]{2,63}$)/'; if ((preg_match($regex, $fqdn) === false) || (preg_match($regex, $fqdn) === 0)) { |