mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 02:39:25 +01:00
Add special handling for the root zone on domain validation and IDNA conversion
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
@@ -12,6 +12,11 @@
|
||||
ini_set('pcre.recursion_limit', 1500);
|
||||
function validDomain($domain_name, &$message = null)
|
||||
{
|
||||
// special handling of the root zone `.`
|
||||
if ($domain_name == '.') {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!preg_match('/^((-|_)*[a-z\\d]((-|_)*[a-z\\d])*(-|_)*)(\\.(-|_)*([a-z\\d]((-|_)*[a-z\\d])*))*$/i', $domain_name)) {
|
||||
if ($message !== null) {
|
||||
$message = 'it contains invalid characters';
|
||||
|
||||
Reference in New Issue
Block a user