From 072978628b0a757b0dce4924b2cb6d0f84b2711e Mon Sep 17 00:00:00 2001 From: Miraty Date: Sun, 3 Oct 2021 18:05:59 +0200 Subject: [PATCH] Allow "-" and "_" in domain names --- inc/form/form.ns.inc.php | 2 +- inc/format.inc.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/inc/form/form.ns.inc.php b/inc/form/form.ns.inc.php index 6e218e8..ae7cc82 100644 --- a/inc/form/form.ns.inc.php +++ b/inc/form/form.ns.inc.php @@ -10,7 +10,7 @@

- +
diff --git a/inc/format.inc.php b/inc/format.inc.php index 4b9bd3c..5b8bf3c 100644 --- a/inc/format.inc.php +++ b/inc/format.inc.php @@ -13,13 +13,13 @@ function checkIpFormat($ip) { function checkAbsoluteDomainFormat($domain) { // If the domain must end with a dot - if (!filter_var($domain, FILTER_VALIDATE_DOMAIN) OR !preg_match("/^([a-z0-9]{1,63}\.){2,127}$/", $domain)) + if (!filter_var($domain, FILTER_VALIDATE_DOMAIN) OR !preg_match("/^([a-z0-9_-]{1,63}\.){2,127}$/", $domain)) exit("ERROR: wrong domain"); } function checkDomainFormat($domain) { // If the domain must end without a dot - if (!filter_var($domain, FILTER_VALIDATE_DOMAIN) OR !preg_match("/^([a-z0-9]{1,63}\.){1,126}[a-z0-9]{1,63}$/", $domain)) + if (!filter_var($domain, FILTER_VALIDATE_DOMAIN) OR !preg_match("/^([a-z0-9_-]{1,63}\.){1,126}[a-z0-9]{1,63}$/", $domain)) exit("ERROR: wrong domain"); }