3 require_once 'HTMLPurifier/AttrDef.php';
6 * Validates the value for the CSS property text-decoration
7 * @note This class could be generalized into a version that acts sort of
8 * like Enum except you can compound the allowed values.
10 class HTMLPurifier_AttrDef_CSS_TextDecoration
extends HTMLPurifier_AttrDef
14 * Lookup table of allowed values.
17 var $allowed_values = array(
18 'line-through' => true,
23 function validate($string, $config, &$context) {
25 $string = strtolower($this->parseCDATA($string));
26 $parts = explode(' ', $string);
28 foreach ($parts as $part) {
29 if (isset($this->allowed_values
[$part])) {
30 $final .= $part . ' ';
33 $final = rtrim($final);
34 if ($final === '') return false;