From 31cefea863545fe0a3182b6bcfdc85d329f2097b Mon Sep 17 00:00:00 2001 From: Denis Fateyev Date: Sun, 1 Mar 2015 20:29:47 +0600 Subject: [PATCH] phpki: punycode hostname support --- include/my_functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/my_functions.php b/include/my_functions.php index 9511379..09af4f7 100644 --- a/include/my_functions.php +++ b/include/my_functions.php @@ -207,7 +207,7 @@ function is_ip( $ip = null ) { function is_fqdn($FQDN) { // remove leading wildcard characters if exist $FQDN = preg_replace('/^\*\./','', $FQDN, 1); - return (!empty($FQDN) && preg_match('/(?=^.{1,254}$)(^(?:(?!\d|-)[a-z0-9\-]{1,63}(? 0); + return (!empty($FQDN) && preg_match('/^(?=.{1,254}$)((?=[a-z0-9-]{1,63}\.)(xn--+)?[a-z0-9]+(-[a-z0-9]+)*\.)+(xn--+)?[a-z0-9]{2,63}$/i', $FQDN) > 0); } #