From e5ce53446c228032fc9e4aaf8efdb044cfeb031a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Wed, 7 Sep 2022 21:43:28 +0200 Subject: [PATCH] Do not apply IDNA conversion to regex domains 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/groups.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/pi-hole/php/groups.php b/scripts/pi-hole/php/groups.php index 8ba2552d..5a12138e 100644 --- a/scripts/pi-hole/php/groups.php +++ b/scripts/pi-hole/php/groups.php @@ -596,14 +596,15 @@ if ($_POST['action'] == 'get_groups') { continue; } - $input = $domain; - // Convert domain name to IDNA ASCII form for international domains - // Skip this for the root zone `.` - if ($domain != '.') { - $domain = convertUnicodeToIDNA($domain); - } if ($_POST['type'] != '2' && $_POST['type'] != '3') { - // If not adding a RegEx, we convert the domain lower case and check whether it is valid + // If not adding a RegEx.... + $input = $domain; + // Convert domain name to IDNA ASCII form for international domains + // Skip this for the root zone `.` + if ($domain != '.') { + $domain = convertUnicodeToIDNA($domain); + } + // convert the domain lower case and check whether it is valid $domain = strtolower($domain); $msg = ''; if (!validDomain($domain, $msg)) {