Class HTMLPurifier_AttrTransform

Description

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.

  • abstract:

Located in /lib/core/Parsers/htmlpurifier/HTMLPurifier.standalone.php (line 528)


	
			
Direct descendents
Class Description
HTMLPurifier_AttrTransform_Background Pre-transform that changes proprietary background attribute to CSS.
HTMLPurifier_AttrTransform_BdoDir Post-trasnform that ensures that bdo tags have the dir attribute set.
HTMLPurifier_AttrTransform_BgColor Pre-transform that changes deprecated bgcolor attribute to CSS.
HTMLPurifier_AttrTransform_BoolToCSS Pre-transform that changes converts a boolean attribute to fixed CSS
HTMLPurifier_AttrTransform_Border Pre-transform that changes deprecated border attribute to CSS.
HTMLPurifier_AttrTransform_EnumToCSS Generic pre-transform that converts an attribute with a fixed number of values (enumerated) to CSS.
HTMLPurifier_AttrTransform_ImgRequired Transform that supplies default values for the src and alt attributes in img tags, as well as prevents the img tag from being removed because of a missing alt tag. This needs to be registered as both a pre and post attribute transform.
HTMLPurifier_AttrTransform_ImgSpace Pre-transform that changes deprecated hspace and vspace attributes to CSS
HTMLPurifier_AttrTransform_Input Performs miscellaneous cross attribute validation and filtering for input elements. This is meant to be a post-transform.
HTMLPurifier_AttrTransform_Lang Post-transform that copies lang's value to xml:lang (and vice-versa)
HTMLPurifier_AttrTransform_Length Class for handling width/height length attribute transformations to CSS
HTMLPurifier_AttrTransform_Name Pre-transform that changes deprecated name attribute to ID if necessary
HTMLPurifier_AttrTransform_NameSync Post-transform that performs validation to the name attribute; if it is present with an equivalent id attribute, it is passed through; otherwise validation is performed.
HTMLPurifier_AttrTransform_SafeEmbed Processes an entire attribute array for corrections needing multiple values.
HTMLPurifier_AttrTransform_SafeObject Writes default type for all objects. Currently only supports flash.
HTMLPurifier_AttrTransform_SafeParam Validates name/value pairs in param tags to be used in safe objects. This will only allow name values it recognizes, and pre-fill certain attributes with required values.
HTMLPurifier_AttrTransform_ScriptRequired Implements required attribute stipulation for <script>
HTMLPurifier_AttrTransform_Textarea Sets height/width defaults for <textarea>
Method Summary
void confiscateAttr ($attr &$attr, $key $key)
void prependCSS ($attr &$attr, $css $css)
Processed transform ($attr $attr, $config $config, $context $context)
Methods
confiscateAttr (line 558)

Retrieves and removes an attribute

  • access: public
void confiscateAttr ($attr &$attr, $key $key)
  • $attr &$attr: Attribute array to process (passed by reference)
  • $key $key: Key of attribute to confiscate
prependCSS (line 548)

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

  • access: public
void prependCSS ($attr &$attr, $css $css)
  • $attr &$attr: Attribute array to process (passed by reference)
  • $css $css: CSS to prepend

Documentation generated on Sun, 06 Mar 2011 00:24:00 -0500 by phpDocumentor 1.4.3