field_validation_plain_text_validator.inc in Field Validation 7.2
File
plugins/validator/field_validation_plain_text_validator.inc
View source
<?php
$plugin = array(
'label' => t('Plain text (disallow tags)'),
'description' => t("Verifies that user-entered data doesn't contain HTML tags."),
'handler' => array(
'class' => 'field_validation_plain_text_validator',
),
);
class field_validation_plain_text_validator extends field_validation_validator {
public function validate() {
if ($this->value != '' && strcmp($this->value, strip_tags($this->value))) {
$this
->set_error();
}
}
}