%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/water/vendor/egulias/email-validator/EmailValidator/Validation/ |
Upload File : |
<?php namespace Egulias\EmailValidator\Validation; use Egulias\EmailValidator\EmailLexer; use Egulias\EmailValidator\Exception\InvalidEmail; use Egulias\EmailValidator\Warning\NoDNSMXRecord; use Egulias\EmailValidator\Exception\NoDNSRecord; class DNSCheckValidation implements EmailValidation { /** * @var array */ private $warnings = []; /** * @var InvalidEmail|null */ private $error; public function __construct() { if (!function_exists('idn_to_ascii')) { throw new \LogicException(sprintf('The %s class requires the Intl extension.', __CLASS__)); } } public function isValid($email, EmailLexer $emailLexer) { // use the input to check DNS if we cannot extract something similar to a domain $host = $email; // Arguable pattern to extract the domain. Not aiming to validate the domain nor the email if (false !== $lastAtPos = strrpos($email, '@')) { $host = substr($email, $lastAtPos + 1); } return $this->checkDNS($host); } public function getError() { return $this->error; } public function getWarnings() { return $this->warnings; } /** * @param string $host * * @return bool */ protected function checkDNS($host) { $variant = INTL_IDNA_VARIANT_2003; if ( defined('INTL_IDNA_VARIANT_UTS46') ) { $variant = INTL_IDNA_VARIANT_UTS46; } $host = rtrim(idn_to_ascii($host, IDNA_DEFAULT, $variant), '.') . '.'; $Aresult = true; $MXresult = checkdnsrr($host, 'MX'); if (!$MXresult) { $this->warnings[NoDNSMXRecord::CODE] = new NoDNSMXRecord(); $Aresult = checkdnsrr($host, 'A') || checkdnsrr($host, 'AAAA'); if (!$Aresult) { $this->error = new NoDNSRecord(); } } return $MXresult || $Aresult; } }