XOOPS 2.5.6
Final
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
Class.php
Go to the documentation of this file.
1
<?php
2
6
class
HTMLPurifier_AttrDef_HTML_Class
extends
HTMLPurifier_AttrDef_HTML_Nmtokens
7
{
8
protected
function
split
($string,
$config
, $context) {
9
// really, this twiddle should be lazy loaded
10
$name =
$config
->getDefinition(
'HTML'
)->doctype->name;
11
if
($name ==
"XHTML 1.1"
|| $name ==
"XHTML 2.0"
) {
12
return
parent::split($string,
$config
, $context);
13
}
else
{
14
return
preg_split(
'/\s+/'
, $string);
15
}
16
}
17
protected
function
filter
($tokens,
$config
, $context) {
18
$allowed
=
$config
->get(
'Attr.AllowedClasses'
);
19
$forbidden =
$config
->get(
'Attr.ForbiddenClasses'
);
20
$ret
= array();
21
foreach
($tokens as
$token
) {
22
if
(
23
(
$allowed
=== null || isset(
$allowed
[$token])) &&
24
!isset($forbidden[$token]) &&
25
// We need this O(n) check because of PHP's array
26
// implementation that casts -0 to 0.
27
!in_array($token,
$ret
,
true
)
28
) {
29
$ret
[] =
$token
;
30
}
31
}
32
return
$ret
;
33
}
34
}
L:
0xoops
xoops-2.5.6
htdocs
xoops_lib
modules
protector
library
HTMLPurifier
AttrDef
HTML
Class.php
Generated on Fri May 10 2013 01:04:29 for XOOPS 2.5.6 by
1.8.3.1