Implements special behavior for class attribute (normally NMTOKENS)
More...
|
| | split ($string, $config, $context) |
| |
| | filter ($tokens, $config, $context) |
| |
| | split ($string, $config, $context) |
| | Splits a space separated list of tokens into its constituent parts. More...
|
| |
| | filter ($tokens, $config, $context) |
| | Template method for removing certain tokens based on arbitrary criteria. More...
|
| |
| | mungeRgb ($string) |
| | Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. More...
|
| |
| | expandCSSEscape ($string) |
| | Parses a possibly escaped CSS string and returns the "pure" version of it. More...
|
| |
|
| | validate ($string, $config, $context) |
| |
| | validate ($string, $config, $context) |
| | Validates and cleans passed string according to a definition. More...
|
| |
| | parseCDATA ($string) |
| | Convenience method that parses a string as if it were CDATA. More...
|
| |
| | make ($string) |
| | Factory method for creating this class from a string. More...
|
| |
| | $minimized = false |
| | Tells us whether or not an HTML attribute is minimized. More...
|
| |
| | $required = false |
| | Tells us whether or not an HTML attribute is required. More...
|
| |
Implements special behavior for class attribute (normally NMTOKENS)
Definition at line 6 of file Class.php.
◆ filter()
| HTMLPurifier_AttrDef_HTML_Class::filter |
( |
|
$tokens, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
|
protected |
- Parameters
-
- Returns
- array
Reimplemented from HTMLPurifier_AttrDef_HTML_Nmtokens.
Definition at line 31 of file Class.php.
32 {
33 $allowed = $config->get('Attr.AllowedClasses');
34 $forbidden = $config->get('Attr.ForbiddenClasses');
36 foreach ($tokens as $token) {
37 if (($allowed === null || isset($allowed[$token])) &&
38 !isset($forbidden[$token]) &&
39
40
41 !in_array($token,
$ret,
true)
42 ) {
44 }
45 }
47 }
References $ret.
◆ split()
| HTMLPurifier_AttrDef_HTML_Class::split |
( |
|
$string, |
|
|
|
$config, |
|
|
|
$context |
|
) |
| |
|
protected |
- Parameters
-
- Returns
- bool|string
Reimplemented from HTMLPurifier_AttrDef_HTML_Nmtokens.
Definition at line 14 of file Class.php.
15 {
16
17 $name = $config->getDefinition('HTML')->doctype->name;
18 if ($name == "XHTML 1.1" || $name == "XHTML 2.0") {
19 return parent::split($string, $config, $context);
20 } else {
21 return preg_split('/\s+/', $string);
22 }
23 }
The documentation for this class was generated from the following file:
- Services/Html/HtmlPurifier/library/HTMLPurifier/AttrDef/HTML/Class.php