XOOPS 2.5.6
Final
Main Page
Related Pages
Classes
Files
Examples
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
Multiple.php
Go to the documentation of this file.
1
<?php
2
14
class
HTMLPurifier_AttrDef_CSS_Multiple
extends
HTMLPurifier_AttrDef
15
{
16
21
public
$single
;
22
27
public
$max
;
28
33
public
function
__construct
(
$single
,
$max
= 4) {
34
$this->single =
$single
;
35
$this->max =
$max
;
36
}
37
38
public
function
validate
($string,
$config
, $context) {
39
$string = $this->
parseCDATA
($string);
40
if
($string ===
''
)
return
false
;
41
$parts = explode(
' '
, $string);
// parseCDATA replaced \r, \t and \n
42
$length = count($parts);
43
$final =
''
;
44
for
(
$i
= 0,
$num
= 0;
$i
< $length &&
$num
<
$this->max
;
$i
++) {
45
if
(ctype_space($parts[
$i
]))
continue
;
46
$result
= $this->single->validate($parts[$i],
$config
, $context);
47
if
(
$result
!==
false
) {
48
$final .=
$result
.
' '
;
49
$num
++;
50
}
51
}
52
if
($final ===
''
)
return
false
;
53
return
rtrim($final);
54
}
55
56
}
57
58
// vim: et sw=4 sts=4
L:
0xoops
xoops-2.5.6
htdocs
xoops_lib
modules
protector
library
HTMLPurifier
AttrDef
CSS
Multiple.php
Generated on Fri May 10 2013 01:04:29 for XOOPS 2.5.6 by
1.8.3.1