4 * Validates the value for the CSS property text-decoration
5 * @note This class could be generalized into a version that acts sort of
6 * like Enum except you can compound the allowed values.
8 class HTMLPurifier_AttrDef_CSS_TextDecoration
extends HTMLPurifier_AttrDef
12 * @param string $string
13 * @param HTMLPurifier_Config $config
14 * @param HTMLPurifier_Context $context
17 public function validate($string, $config, $context)
19 static $allowed_values = array(
20 'line-through' => true,
25 $string = strtolower($this->parseCDATA($string));
27 if ($string === 'none') {
31 $parts = explode(' ', $string);
33 foreach ($parts as $part) {
34 if (isset($allowed_values[$part])) {
35 $final .= $part . ' ';
38 $final = rtrim($final);