Skip to content

Commit

Permalink
avoid "Undefined variable $unicode" warnings
Browse files Browse the repository at this point in the history
In the original form I was getting warnings like 
```
<b>Warning</b>:  Undefined variable $unicode in <b>/var/www/html/admin/scripts/pi-hole/php/func.php</b> on line <b>687</b><br />
```
printed in the HTML output of `/scripts/pi-hole/php/groups.php`, which was not a valid JSON any more and led to an error displaying the blacklisted domains.

Signed-off-by: Costin Grigoras <[email protected]>
  • Loading branch information
costing authored Jan 2, 2025
1 parent 5c8945c commit b525cd3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/pi-hole/php/func.php
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ function convertIDNAToUnicode($IDNA)
}

// if the conversion failed (e.g. domain to long) return the original domain
if ($unicode == false) {
if (!isset($unicode) || $unicode == false) {
return $IDNA;
} else {
return $unicode;
Expand Down

0 comments on commit b525cd3

Please sign in to comment.