ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
Class.php
Go to the documentation of this file.
1<?php
2
7{
14 protected function split($string, $config, $context)
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 }
24
31 protected function filter($tokens, $config, $context)
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 }
48}
An exception for terminatinating execution or to throw for unit testing.
Implements special behavior for class attribute (normally NMTOKENS)
Definition: Class.php:7
filter($tokens, $config, $context)
Definition: Class.php:31
split($string, $config, $context)
Definition: Class.php:14
Validates contents based on NMTOKENS attribute type.
Definition: Nmtokens.php:7
$config
Definition: bootstrap.php:15
split($path)
Returns the 'dirname' and 'basename' for a path.
Definition: functions.php:279
$ret
Definition: parser.php:6
$context
Definition: webdav.php:25