From a7ec9510b51f1630d4decf0f5ab3d79e9c09ffee Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Wed, 4 Aug 2021 20:44:20 +0100 Subject: [PATCH] re-implement fix introduced in 1664090a011f5ffe160416078a54ff972f12e069 Release v5.5.1 (based on `master`) has fixed this in `savesettings.php`, but the functionality has since been moved to `func.php` in `devel`, and so the fix needs applying here, too. Signed-off-by: Adam Warner --- scripts/pi-hole/php/func.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pi-hole/php/func.php b/scripts/pi-hole/php/func.php index c2e42b48..12e41061 100644 --- a/scripts/pi-hole/php/func.php +++ b/scripts/pi-hole/php/func.php @@ -34,7 +34,7 @@ function validDomain($domain_name, &$message = NULL) function validDomainWildcard($domain_name) { // 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); + $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); $labelLengthCheck = preg_match("/^[^\.]{1,63}(\.[^\.]{1,63})*$/", $domain_name); return ( $validChars && $lengthCheck && $labelLengthCheck ); //length of each label