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
13 function validate($string, $config, &$context) {
15 static $allowed_values = array(
16 'line-through' => true,
21 $string = strtolower($this->parseCDATA($string));
22 $parts = explode(' ', $string);
24 foreach ($parts as $part) {
25 if (isset($allowed_values[$part])) {
26 $final .= $part . ' ';
29 $final = rtrim($final);
30 if ($final === '') return false;