ILIAS
eassessment Revision 61809
◀ ilDoc Overview
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Groups
Pages
MultiLength.php
Go to the documentation of this file.
1
<?php
2
9
class
HTMLPurifier_AttrDef_HTML_MultiLength
extends
HTMLPurifier_AttrDef_HTML_Length
10
{
11
12
public
function
validate
($string,
$config
, $context) {
13
14
$string = trim($string);
15
if
($string ===
''
)
return
false
;
16
17
$parent_result =
parent::validate
($string,
$config
, $context);
18
if
($parent_result !==
false
)
return
$parent_result;
19
20
$length = strlen($string);
21
$last_char = $string[$length - 1];
22
23
if
($last_char !==
'*'
)
return
false
;
24
25
$int = substr($string, 0, $length - 1);
26
27
if
($int ==
''
)
return
'*'
;
28
if
(!is_numeric($int))
return
false
;
29
30
$int = (int) $int;
31
32
if
($int < 0)
return
false
;
33
if
($int == 0)
return
'0'
;
34
if
($int == 1)
return
'*'
;
35
return
((
string
) $int) .
'*'
;
36
37
}
38
39
}
40
41
// vim: et sw=4 sts=4
Services
Html
HtmlPurifier
library
HTMLPurifier
AttrDef
HTML
MultiLength.php
Generated on Mon Apr 25 2016 19:01:31 for ILIAS by
1.8.1.2 (using
Doxyfile
)