function validate() { if ($this->filter_html) { $this->_value = $this->_validator->filterHtml($this->_value); } return parent::validate(); }
/** * This function will validate the element's value against defined validation rules (e.g. not null, ...) * * The validation will also activate the error flag, if any * rule is broken, which will trigger the error message in * form mode output. * * @see setMaximumLength() * @see FormElement::validate() * @return boolean TRUE if no errors occurred */ public function validate() { parent::validate(); $value = trim($this->value()); // only use reg exp validation if value is not empty. // an empty value validation should be made with setNotNull() if (!$this->isEmpty() && $this->validRegExp() != '' && !preg_match($this->validRegExp(), $value)) { $this->setError('REGEXP MISMATCH'); } $this->_isValidated = true; return !$this->error(); }