The validation succeeds if the input data matches the regular expression.
The validation always succeeds if ControlToValidate is not specified
or the regular expression is empty, or the input data is empty.
public evaluateIsValid ( ) : boolean | ||
Résultat | boolean | whether the validation succeeds |
/** * Returns an array of javascript validator options. * @return array javascript validator options. */ public function evaluateIsValid() { $value = $this->getValidationValue($this->getValidationTarget()); $valid = $valid = is_string($value) && strlen($value) <= 254 && parent::evaluateIsValid(); if ($valid && $this->getCheckMXRecord() && function_exists('checkdnsrr')) { if ($value !== '') { if (($pos = strpos($value, '@')) !== false) { $domain = substr($value, $pos + 1); return $domain === '' ? false : checkdnsrr($domain, 'MX'); } else { return false; } } } return $valid; }