Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / lib / htmlpurifier / HTMLPurifier / AttrDef / CSS / DenyElementDecorator.php
blobb0a6db9dee3592d5a2c31c2a41201c7d60b39b2c
1 <?php
3 /**
4 * Decorator which enables CSS properties to be disabled for specific elements.
5 */
6 class HTMLPurifier_AttrDef_CSS_DenyElementDecorator extends HTMLPurifier_AttrDef
8 var $def, $element;
10 /**
11 * @param $def Definition to wrap
12 * @param $element Element to deny
14 function HTMLPurifier_AttrDef_CSS_DenyElementDecorator(&$def, $element) {
15 $this->def =& $def;
16 $this->element = $element;
18 /**
19 * Checks if CurrentToken is set and equal to $this->element
21 function validate($string, $config, $context) {
22 $token = $context->get('CurrentToken', true);
23 if ($token && $token->name == $this->element) return false;
24 return $this->def->validate($string, $config, $context);