From e944c9d6c709bdec093cade8245ff5bb5251fa63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Tue, 20 Sep 2022 16:16:40 +0200 Subject: [PATCH] Allow the root zone `.` to be excluded from top lists MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- scripts/pi-hole/php/func.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scripts/pi-hole/php/func.php b/scripts/pi-hole/php/func.php index ce2e2824..712e588a 100644 --- a/scripts/pi-hole/php/func.php +++ b/scripts/pi-hole/php/func.php @@ -45,6 +45,10 @@ function validDomain($domain_name, &$message = null) function validDomainWildcard($domain_name) { + // Skip this checks for the root zone `.` + if ($domain_name == '.') { + return true; + } // There has to be either no or at most one "*" at the beginning of a line $validChars = preg_match('/^((\\*\\.)?[_a-z\\d](-*[_a-z\\d])*)(\\.([_a-z\\d](-*[a-z\\d])*))*(\\.([_a-z\\d])*)*$/i', $domain_name); $lengthCheck = preg_match('/^.{1,253}$/', $domain_name);