Class HTMLPurifier_AttrDef_CSS_Composite

InheritanceHTMLPurifier_AttrDef_CSS_Composite » HTMLPurifier_AttrDef

Allows multiple validators to attempt to validate attribute.

Composite is just what it sounds like: a composite of many validators. This means that multiple HTMLPurifier_AttrDef objects will have a whack at the string. If one of them passes, that's what is returned. This is especially useful for CSS values, which often are a choice between an enumerated set of predefined values or a flexible data type.

Public Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$defs List of objects that may process strings. HTMLPurifier_AttrDef_CSS_Composite
$minimized Tells us whether or not an HTML attribute is minimized. HTMLPurifier_AttrDef
$required Tells us whether or not an HTML attribute is required. HTMLPurifier_AttrDef

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() HTMLPurifier_AttrDef_CSS_Composite
make() Factory method for creating this class from a string. HTMLPurifier_AttrDef
parseCDATA() Convenience method that parses a string as if it were CDATA. HTMLPurifier_AttrDef
validate() HTMLPurifier_AttrDef_CSS_Composite

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
expandCSSEscape() Parses a possibly escaped CSS string and returns the "pure" version of it. HTMLPurifier_AttrDef
mungeRgb() Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK! HTMLPurifier_AttrDef

Property Details

$defs public property
public $defs null

Method Details

__construct() public method

public void __construct ( $defs )
$defs HTMLPurifier_AttrDef[]

List of HTMLPurifier_AttrDef objects

validate() public method

public bool|string validate ( $string, $config, $context )
$string string
$config HTMLPurifier_Config
$context HTMLPurifier_Context