ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f87
HTMLPurifier_AttrDef_CSS_AlphaValue Class Reference
+ Inheritance diagram for HTMLPurifier_AttrDef_CSS_AlphaValue:
+ Collaboration diagram for HTMLPurifier_AttrDef_CSS_AlphaValue:

Public Member Functions

 __construct ()
 
 validate ($number, $config, $context)
 
- Public Member Functions inherited from HTMLPurifier_AttrDef_CSS_Number
 __construct ($non_negative=false)
 
 validate ($number, $config, $context)
 
- Public Member Functions inherited from HTMLPurifier_AttrDef
 validate ($string, $config, $context)
 Validates and cleans passed string according to a definition. More...
 
 parseCDATA ($string)
 Convenience method that parses a string as if it were CDATA. More...
 
 make ($string)
 Factory method for creating this class from a string. More...
 

Additional Inherited Members

- Data Fields inherited from HTMLPurifier_AttrDef
 $minimized = false
 Tells us whether or not an HTML attribute is minimized. More...
 
 $required = false
 Tells us whether or not an HTML attribute is required. More...
 
- Protected Member Functions inherited from HTMLPurifier_AttrDef
 mungeRgb ($string)
 Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. More...
 
 expandCSSEscape ($string)
 Parses a possibly escaped CSS string and returns the "pure" version of it. More...
 
- Protected Attributes inherited from HTMLPurifier_AttrDef_CSS_Number
 $non_negative = false
 Indicates whether or not only positive values are allowed. More...
 

Detailed Description

Definition at line 3 of file AlphaValue.php.

Constructor & Destructor Documentation

◆ __construct()

HTMLPurifier_AttrDef_CSS_AlphaValue::__construct ( )

Definition at line 6 of file AlphaValue.php.

7  {
8  parent::__construct(false); // opacity is non-negative, but we will clamp it
9  }

Member Function Documentation

◆ validate()

HTMLPurifier_AttrDef_CSS_AlphaValue::validate (   $number,
  $config,
  $context 
)
Parameters
string$number
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Returns
string

Definition at line 17 of file AlphaValue.php.

References $result.

18  {
19  $result = parent::validate($number, $config, $context);
20  if ($result === false) {
21  return $result;
22  }
23  $float = (float)$result;
24  if ($float < 0.0) {
25  $result = '0';
26  }
27  if ($float > 1.0) {
28  $result = '1';
29  }
30  return $result;
31  }
$result

The documentation for this class was generated from the following file: