mirror of
https://github.com/pi-hole/web.git
synced 2026-04-23 18:29:43 +01:00
re-implement fix introduced in 1664090a01
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 <me@adamwarner.co.uk>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user