Fix inverse logic when adding domains on the group management pages.

Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
DL6ER
2021-07-25 19:03:34 +02:00
parent 03920e3595
commit 559150bb1f
3 changed files with 26 additions and 19 deletions

View File

@@ -646,15 +646,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(validDomain($domain))
$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");
}
}