mirror of
https://github.com/pi-hole/web.git
synced 2026-04-24 02:39:25 +01:00
Merge branch 'release/v5.6' into devel
This commit is contained in:
@@ -649,15 +649,16 @@ if ($_POST['action'] == 'get_groups') {
|
||||
{
|
||||
// If adding to the exact lists, we convert the domain lower case and check whether it is valid
|
||||
$domain = strtolower($domain);
|
||||
if(filter_var($domain, FILTER_VALIDATE_DOMAIN, FILTER_FLAG_HOSTNAME) === false)
|
||||
$msg = "";
|
||||
if(!validDomain($domain, $msg))
|
||||
{
|
||||
// This is the case when idn_to_ascii() modified the string
|
||||
if($input !== $domain && strlen($domain) > 0)
|
||||
$errormsg = 'Domain ' . htmlentities($input) . ' (converted to "' . htmlentities(utf8_encode($domain)) . '") is not a valid domain.';
|
||||
$errormsg = 'Domain ' . htmlentities($input) . ' (converted to "' . htmlentities(utf8_encode($domain)) . '") is not a valid domain because ' . $msg . '.';
|
||||
elseif($input !== $domain)
|
||||
$errormsg = 'Domain ' . htmlentities($input) . ' is not a valid domain.';
|
||||
$errormsg = 'Domain ' . htmlentities($input) . ' is not a valid domain because ' . $msg . '.';
|
||||
else
|
||||
$errormsg = 'Domain ' . htmlentities(utf8_encode($domain)) . ' is not a valid domain.';
|
||||
$errormsg = 'Domain ' . htmlentities(utf8_encode($domain)) . ' is not a valid domain because ' . $msg . '.';
|
||||
throw new Exception($errormsg . '<br>Added ' . $added . " out of ". $total . " domains");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user