ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
HTMLPurifier_AttrDef_HTML_Class Class Reference

Implements special behavior for class attribute (normally NMTOKENS) More...

+ Inheritance diagram for HTMLPurifier_AttrDef_HTML_Class:
+ Collaboration diagram for HTMLPurifier_AttrDef_HTML_Class:

Protected Member Functions

 split ($string, $config, $context)
 
 filter ($tokens, $config, $context)
 
- Protected Member Functions inherited from HTMLPurifier_AttrDef_HTML_Nmtokens
 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...
 
- Protected Member Functions inherited from HTMLPurifier_AttrDef
 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...
 

Additional Inherited Members

- Public Member Functions inherited from HTMLPurifier_AttrDef_HTML_Nmtokens
 validate ($string, $config, $context)
 
- Public Member Functions inherited from HTMLPurifier_AttrDef
 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...
 
- Data Fields inherited from HTMLPurifier_AttrDef
 $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...
 

Detailed Description

Implements special behavior for class attribute (normally NMTOKENS)

Definition at line 6 of file Class.php.

Member Function Documentation

◆ filter()

HTMLPurifier_AttrDef_HTML_Class::filter (   $tokens,
  $config,
  $context 
)
protected
Parameters
array$tokens
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Returns
array

Definition at line 31 of file Class.php.

References $config, $ret, and array.

32  {
33  $allowed = $config->get('Attr.AllowedClasses');
34  $forbidden = $config->get('Attr.ForbiddenClasses');
35  $ret = array();
36  foreach ($tokens as $token) {
37  if (($allowed === null || isset($allowed[$token])) &&
38  !isset($forbidden[$token]) &&
39  // We need this O(n) check because of PHP's array
40  // implementation that casts -0 to 0.
41  !in_array($token, $ret, true)
42  ) {
43  $ret[] = $token;
44  }
45  }
46  return $ret;
47  }
Create styles array
The data for the language used.
$ret
Definition: parser.php:6

◆ split()

HTMLPurifier_AttrDef_HTML_Class::split (   $string,
  $config,
  $context 
)
protected
Parameters
string$string
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Returns
bool|string

Definition at line 14 of file Class.php.

References $config, and $name.

15  {
16  // really, this twiddle should be lazy loaded
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  }
if($format !==null) $name
Definition: metadata.php:146

The documentation for this class was generated from the following file: