Abstract Class HTMLPurifier_AttrTransform

InheritanceHTMLPurifier_AttrTransform
SubclassesHTMLPurifier_AttrTransform_Background, HTMLPurifier_AttrTransform_BdoDir, HTMLPurifier_AttrTransform_BgColor, HTMLPurifier_AttrTransform_BoolToCSS, HTMLPurifier_AttrTransform_Border, HTMLPurifier_AttrTransform_EnumToCSS, HTMLPurifier_AttrTransform_ImgRequired, HTMLPurifier_AttrTransform_ImgSpace, HTMLPurifier_AttrTransform_Input, HTMLPurifier_AttrTransform_Lang, HTMLPurifier_AttrTransform_Length, HTMLPurifier_AttrTransform_Name, HTMLPurifier_AttrTransform_NameSync, HTMLPurifier_AttrTransform_Nofollow, HTMLPurifier_AttrTransform_SafeEmbed, HTMLPurifier_AttrTransform_SafeObject, HTMLPurifier_AttrTransform_SafeParam, HTMLPurifier_AttrTransform_ScriptRequired, HTMLPurifier_AttrTransform_TargetBlank, HTMLPurifier_AttrTransform_Textarea

Processes an entire attribute array for corrections needing multiple values.

Occasionally, a certain attribute will need to be removed and popped onto another value. Instead of creating a complex return syntax for HTMLPurifier_AttrDef, we just pass the whole attribute array to a specialized object and have that do the special work. That is the family of HTMLPurifier_AttrTransform.

An attribute transformation can be assigned to run before or after HTMLPurifier_AttrDef validation. See HTMLPurifier_HTMLDefinition for more details.

Public Methods

Hide inherited methods

MethodDescriptionDefined By
confiscateAttr() Retrieves and removes an attribute HTMLPurifier_AttrTransform
prependCSS() Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist. HTMLPurifier_AttrTransform
transform() Abstract: makes changes to the attributes dependent on multiple values. HTMLPurifier_AttrTransform

Method Details

confiscateAttr() public method

Retrieves and removes an attribute

public mixed confiscateAttr ( <b>&</b>$attr, $key )
$attr
$key mixed

Key of attribute to confiscate

prependCSS() public method

Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist.

public void prependCSS ( <b>&</b>$attr, $css )
$attr
$css string

CSS to prepend

transform() public abstract method

Abstract: makes changes to the attributes dependent on multiple values.

public abstract array transform ( $attr, $config, $context )
$attr array

Assoc array of attributes, usually from

         HTMLPurifier_Token_Tag::$attr
$config HTMLPurifier_Config

Mandatory HTMLPurifier_Config object.

$context HTMLPurifier_Context

Mandatory HTMLPurifier_Context object

return array

Processed attribute array.