ILIAS
release_4-4 Revision
◀ ilDoc Overview
AlphaValue.php
Go to the documentation of this file.
1
<?php
2
3
class
HTMLPurifier_AttrDef_CSS_AlphaValue
extends
HTMLPurifier_AttrDef_CSS_Number
4
{
5
6
public
function
__construct
() {
7
parent::__construct(
false
);
// opacity is non-negative, but we will clamp it
8
}
9
10
public
function
validate
($number, $config, $context) {
11
$result
= parent::validate($number, $config, $context);
12
if
(
$result
===
false
)
return
$result
;
13
$float = (float)
$result
;
14
if
($float < 0.0)
$result
=
'0'
;
15
if
($float > 1.0)
$result
=
'1'
;
16
return
$result
;
17
}
18
19
}
20
21
// vim: et sw=4 sts=4
HTMLPurifier_AttrDef_CSS_AlphaValue\validate
validate($number, $config, $context)
Definition:
AlphaValue.php:10
$result
$result
Definition:
CleanUpTest.php:407
HTMLPurifier_AttrDef_CSS_Number
Validates a number as defined by the CSS spec.
Definition:
Number.php:6
HTMLPurifier_AttrDef_CSS_AlphaValue
Definition:
AlphaValue.php:3
HTMLPurifier_AttrDef_CSS_AlphaValue\__construct
__construct()
Definition:
AlphaValue.php:6
Services
Html
HtmlPurifier
library
HTMLPurifier
AttrDef
CSS
AlphaValue.php
Generated on Mon Dec 21 2020 19:01:15 for ILIAS by
1.8.13 (using
Doxyfile
)