Merge pull request #976 from csware/alias-id-check

Check for address validity before checking domain existence
This commit is contained in:
David Goodwin authored and GitHub committed 2026-01-26 09:45:49 +00:00
commit 8e9860432b
1 file changed
+9 -13
+9 -13
View File
@@ -196,30 +196,26 @@ class AliasHandler extends PFAHandler
list($local_part, $domain) = explode('@', $this->id);
if (!$this->create_allowed($domain)) {
$this->errormsg[$this->id_field] = Config::lang('pCreate_alias_address_text_error3');
return false;
}
# TODO: already checked in set() - does it make sense to check it here also? Only advantage: it's an early check
# if (!in_array($domain, $this->allowed_domains)) {
# $this->errormsg[] = Config::lang('pCreate_alias_address_text_error1');
# return false;
# }
if ($local_part == '') { # catchall
$valid = true;
} else {
if ($local_part != '') { # catchall
$email_check = check_email($this->id);
if ($email_check == '') {
$valid = true;
} else {
if ($email_check != '') {
$this->errormsg[$this->id_field] = $email_check;
$valid = false;
return false;
}
}
return $valid;
if (!$this->create_allowed($domain)) {
$this->errormsg[$this->id_field] = Config::lang('pCreate_alias_address_text_error3');
return false;
}
return true;
}
/**