/** * Returns an array of javascript validator options. * @return array javascript validator options. */ public function evaluateIsValid() { $valid = parent::evaluateIsValid(); if ($valid && $this->getCheckMXRecord() && function_exists('checkdnsrr')) { if (($value = $this->getValidationValue($this->getValidationTarget())) !== '') { if (($pos = strpos($value, '@')) !== false) { $domain = substr($value, $pos + 1); return $domain === '' ? false : checkdnsrr($domain, 'MX'); } else { return false; } } } return $valid; }
public function evaluateIsValid() { $valid = parent::evaluateIsValid(); if ($valid && function_exists('checkdnsrr')) { $idPath = $this->getControlToValidate(); if (strlen($idPath)) { $control = $this->getTargetControl($idPath); $value = $control->getValidationPropertyValue(); if (strlen($value)) { $pos = strpos($value, '@'); if ($pos === false) { $valid = false; } else { $domain = substr($value, $pos + 1); $valid = strlen($domain) ? checkdnsrr($domain, 'MX') : false; } } } } return $valid; }