@ -260,11 +260,8 @@ function check_email ($email)
$ce_email = preg_replace("/#/", '@', $ce_email);
}
if (
isset($CONF['emailcheck_resolve_domain'])
& & 'YES'==$CONF['emailcheck_resolve_domain']
& & 'WINDOWS'!=(strtoupper(substr(php_uname('s'), 0, 7)))
) {
if (isset($CONF['emailcheck_resolve_domain']) & & 'YES' == $CONF['emailcheck_resolve_domain'] & & 'WINDOWS'!=(strtoupper(substr(php_uname('s'), 0, 7))))
{
// Perform non-domain-part sanity checks
if (!preg_match ('/^[-!#$%& \'*+\\.\/0-9=?A-Z^_{|}~]+' . '@' . '[^@]+$/i', trim ($ce_email)))
@ -290,19 +287,20 @@ function check_email ($email)
}
if (checkdnsrr($domain,'A')) return true;
if (checkdnsrr($domain,'MX')) return true;
}
# TODO: different error message for non-existing domains (instead of "email is invalid")
flash_error("Invalid domain, and/or not discoverable in DNS");
return false;
}
else {
flash_error("emailcheck_resolve_domain is enabled, but function (checkdnsrr) missing!");
}
}
if (preg_match ('/^[-!#$%& \'*+\\.\/0-9=?A-Z^_{|}~]+' . '@' . '([-0-9A-Z]+\.)+' . '([0-9A-Z]){2,6}$/i', trim ($ce_email)))
{
return true;
}
else
{
flash_error("Invalid email address, fails regexp check");
return false;
}
}
@ -851,7 +849,7 @@ function domain_exist ($domain)
{
global $table_domain;
$result = db_query ("SELECT 1 FROM $table_domain WHERE domain='$domain'");
$result = db_query("SELECT 1 FROM $table_domain WHERE domain='$domain'");
if ($result['rows'] != 1)
{
return false;