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));
23
if ($string === 'none') return $string;
25
$parts = explode(' ', $string);
27
foreach ($parts as $part) {
28
if (isset($allowed_values[$part])) {
29
$final .= $part . ' ';
32
$final = rtrim($final);
33
if ($final === '') return false;