Skip to content

Commit

Permalink
Do not apply IDNA conversion to RegEx domains (#2336)
Browse files Browse the repository at this point in the history
  • Loading branch information
DL6ER authored Sep 8, 2022
2 parents dbd87d8 + e5ce534 commit c958cc8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions scripts/pi-hole/php/groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -596,14 +596,15 @@ function verify_ID_array($arr)
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)) {
Expand Down

0 comments on commit c958cc8

Please sign in to comment.