Ignore:
Timestamp:
Jun 9, 2022 7:24:04 PM (2 years ago)
Author:
anonymous
Message:

Minor improvements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Validator.inc.php

    r767 r768  
    348348        }
    349349
    350         if ($strict) {
    351             // Strict tests.
    352             if (ip2long($domain) === false && function_exists('checkdnsrr') && !checkdnsrr($domain . '.', 'MX') && gethostbyname($domain) == $domain) {
    353                 // Check domain exists: It's a domain if ip2long fails; checkdnsrr ensures a MX record exists; gethostbyname() ensures the domain exists.
    354                 $app->logMsg(sprintf('%s (line %s) failed: %s', __METHOD__, __LINE__, getDump($val)), $type, $file, $line);
    355                 return self::EMAIL_MX_FAIL;
    356             }
     350        if ($strict && getmxrr('checkdnsrr') && !getmxrr($domain)) {
     351            // Strict tests: check if MX record exists.
     352            $app->logMsg(sprintf('%s (line %s) failed: %s', __METHOD__, __LINE__, getDump($val)), $type, $file, $line);
     353            return self::EMAIL_MX_FAIL;
    357354        }
    358355
Note: See TracChangeset for help on using the changeset viewer.