include/HTMLPurifier/HTMLPurifier.standalone.php

Show: inherited
Table of Contents

Constants

Constant  HTMLPURIFIER_PREFIX = dirname(__FILE__) . '/standalone'
Constant  PHP_EOL = "\n"

\HTMLPurifier

Package: SugarCRM

Facade that coordinates HTML Purifier's subsystems in order to purify HTML.

Note
There are several points in which configuration can be specified for HTML Purifier. The precedence of these (from lowest to highest) is as follows: -# Instance: new HTMLPurifier($config) -# Invocation: purify($html, $config) These configurations are entirely independent of each other and are *not* merged (this behavior may change in the future).  
Todo
We need an easier way to inject strategies using the configuration object.  

Constants

Constant  VERSION = '4.3.0'

Constant with version of HTML Purifier

Properties

Propertypublic  $config= ''

Global configuration object

Details
Type
n/a
Propertypublic  $context= ''

Resultant HTMLPurifier_Context of last run purification. Is an array of contexts if the last called method was purifyArray().

Details
Type
n/a
Propertyprivate  $filters= 'array()'

Array of extra HTMLPurifier_Filter objects to run on HTML, for backwards compatibility

Default valuearray()Details
Type
n/a
Propertypublic  $generator= ''
Details
Type
n/a
Propertyprivate  $instance= ''
static

Single instance of HTML Purifier

Details
Type
n/a
Propertyprotected  $strategy= ''
Details
Type
n/a
Propertypublic  $version= ''4.3.0''

Version of HTML Purifier

Default value'4.3.0'Details
Type
n/a

Methods

methodpublic__construct( \$config $config = null ) : void

Initializes the purifier.

Parameters
Name Type Description
$config \$config

Optional HTMLPurifier_Config object for all instances of the purifier, if omitted, a default configuration is supplied (which can be overridden on a per-use basis). The parameter can also be any type that HTMLPurifier_Config::create() supports.

methodpublicaddFilter( \$filter $filter ) : void

Adds a filter to process the output. First come first serve

Parameters
Name Type Description
$filter \$filter

HTMLPurifier_Filter object

methodpublicgetInstance(  $prototype = null ) : void
static

Parameters
Name Type Description
$prototype
Details
Note
Backwards compatibility, see instance()  
methodpublicinstance( \$prototype $prototype = null ) : void
static

Singleton for enforcing just one HTML Purifier in your system

Parameters
Name Type Description
$prototype \$prototype

Optional prototype HTMLPurifier instance to overload singleton with, or HTMLPurifier_Config instance to configure the generated version with.

methodpublicpurify( \$html $html, \$config $config = null ) : \Purified

Filters an HTML snippet/document to be XSS-free and standards-compliant.

Parameters
Name Type Description
$html \$html

String of HTML to purify

$config \$config

HTMLPurifier_Config object for this operation, if omitted, defaults to the config object specified during this object's construction. The parameter can also be any type that HTMLPurifier_Config::create() supports.

Returns
Type Description
\Purified HTML
methodpublicpurifyArray( \$config $array_of_html,  $config = null ) : Array

Filters an array of HTML snippets

Parameters
Name Type Description
$array_of_html \$config

Optional HTMLPurifier_Config object for this operation. See HTMLPurifier::purify() for more details.

$config
Returns
Type Description
Array of purified HTML

\HTMLPurifier_AttrCollections

Package: SugarCRM

Defines common attribute collections that modules reference

Properties

Propertypublic  $info= 'array()'

Associative array of attribute collections, indexed by name

Default valuearray()Details
Type
n/a

Methods

methodpublic__construct( \$attr_types $attr_types, \$modules $modules ) : void

Performs all expansions on internal data for use by other inclusions It also collects all attribute collection extensions from modules

Parameters
Name Type Description
$attr_types \$attr_types

HTMLPurifier_AttrTypes instance

$modules \$modules

Hash array of HTMLPurifier_HTMLModule members

methodpublicexpandIdentifiers( \$attr $attr, \$attr_types $attr_types ) : void

Expands all string identifiers in an attribute array by replacing them with the appropriate values inside HTMLPurifier_AttrTypes

Parameters
Name Type Description
$attr \$attr

Reference to attribute array

$attr_types \$attr_types

HTMLPurifier_AttrTypes instance

methodpublicperformInclusions( \$attr $attr ) : void

Takes a reference to an attribute associative array and performs all inclusions specified by the zero index.

Parameters
Name Type Description
$attr \$attr

Reference to attribute array

\HTMLPurifier_AttrDef

Package: SugarCRM

Base class for all validating attribute definitions.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Children
\HTMLPurifier_AttrDef_CSS
\HTMLPurifier_AttrDef_Enum
\HTMLPurifier_AttrDef_Integer
\HTMLPurifier_AttrDef_Lang
\HTMLPurifier_AttrDef_Text
\HTMLPurifier_AttrDef_URI
\HTMLPurifier_AttrDef_CSS_Number
\HTMLPurifier_AttrDef_CSS_Background
\HTMLPurifier_AttrDef_CSS_BackgroundPosition
\HTMLPurifier_AttrDef_CSS_Border
\HTMLPurifier_AttrDef_CSS_Color
\HTMLPurifier_AttrDef_CSS_Composite
\HTMLPurifier_AttrDef_CSS_DenyElementDecorator
\HTMLPurifier_AttrDef_CSS_Filter
\HTMLPurifier_AttrDef_CSS_Font
\HTMLPurifier_AttrDef_CSS_FontFamily
\HTMLPurifier_AttrDef_CSS_ImportantDecorator
\HTMLPurifier_AttrDef_CSS_Length
\HTMLPurifier_AttrDef_CSS_ListStyle
\HTMLPurifier_AttrDef_CSS_Multiple
\HTMLPurifier_AttrDef_CSS_Percentage
\HTMLPurifier_AttrDef_CSS_TextDecoration
\HTMLPurifier_AttrDef_HTML_Bool
\HTMLPurifier_AttrDef_HTML_Nmtokens
\HTMLPurifier_AttrDef_HTML_Color
\HTMLPurifier_AttrDef_HTML_ID
\HTMLPurifier_AttrDef_HTML_Pixels
\HTMLPurifier_AttrDef_HTML_LinkTypes
\HTMLPurifier_AttrDef_URI_Email
\HTMLPurifier_AttrDef_URI_Host
\HTMLPurifier_AttrDef_URI_IPv4

Properties

Propertypublic  $minimized= 'false'

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Default valuefalseDetails
Type
n/a
Propertypublic  $required= 'false'

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Default valuefalseDetails
Type
n/a

Methods

methodprotectedexpandCSSEscape(  $string ) : void

Parses a possibly escaped CSS string and returns the "pure" version of it.

Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created

Factory method for creating this class from a string.

Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void

Convenience method that parses a string as if it were CDATA.

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void
abstract

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS

Package: SugarCRM

Validates the HTML attribute style, otherwise known as CSS.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Note
We don't implement the whole CSS specification, so it might be difficult to reuse this component in the context of validating actual stylesheet declarations.  
Note
If we were really serious about validating the CSS, we would tokenize the styles and then parse the tokens. Obviously, we are not doing that. Doing that could seriously harm performance, but would make these components a lot more viable for a CSS filtering solution.  

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate(  $css, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$css
$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_AlphaValue

Package:

Validates a number as defined by the CSS spec.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef_CSS_Number < \HTMLPurifier_AttrDef

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized\HTMLPurifier_AttrDef_CSS_Number::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Inherited_from
\HTMLPurifier_AttrDef_CSS_Number::$$minimized  
Propertyprotected  $non_negative= 'false'
inherited

Bool indicating whether or not only positive values allowed.

Inherited from: \HTMLPurifier_AttrDef_CSS_Number::$$non_negative
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef_CSS_Number::$$non_negative  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required\HTMLPurifier_AttrDef_CSS_Number::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  
Inherited_from
\HTMLPurifier_AttrDef_CSS_Number::$$required  

Methods

methodpublic__construct( ) : void

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()\HTMLPurifier_AttrDef_CSS_Number::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()\HTMLPurifier_AttrDef_CSS_Number::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()\HTMLPurifier_AttrDef_CSS_Number::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()\HTMLPurifier_AttrDef_CSS_Number::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate(  $number, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$number
$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_Background

Package: SugarCRM

Validates shorthand CSS property background.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Warning
Does not support url tokens that have internal spaces.  

Properties

Propertyprotected  $info= ''

Local copy of component validators.

Details
Type
n/a
Note
See HTMLPurifier_AttrDef_Font::$info for a similar impl.  
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct(  $config ) : void

Parameters
Name Type Description
$config
methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_BackgroundPosition

Package: SugarCRM

Validates the value of background-position.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertyprotected  $length= ''
Details
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertyprotected  $percentage= ''
Details
Type
n/a
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct( ) : void

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_Border

Package: SugarCRM

Validates the border property as defined by CSS.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertyprotected  $info= 'array()'

Local copy of properties this property is shorthand for.

Default valuearray()Details
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct(  $config ) : void

Parameters
Name Type Description
$config
methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_Color

Package: SugarCRM

Validates Color as defined by CSS.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate(  $color, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$color
$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_Composite

Package: SugarCRM

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.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertypublic  $defs= ''

List of HTMLPurifier_AttrDef objects that may process strings

Details
Type
n/a
Todo
Make protected  
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct( \$defs $defs ) : void

Parameters
Name Type Description
$defs \$defs

List of HTMLPurifier_AttrDef objects

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_DenyElementDecorator

Package: SugarCRM

Decorator which enables CSS properties to be disabled for specific elements.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertypublic  $def= ''
Details
Type
n/a
Propertypublic  $element= ''
Details
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct( \$def $def, \$element $element ) : void

Parameters
Name Type Description
$def \$def

Definition to wrap

$element \$element

Element to deny

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Checks if CurrentToken is set and equal to $this->element

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_Filter

Package: SugarCRM

Microsoft's proprietary filter: CSS property

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Note
Currently supports the alpha filter. In the future, this will probably need an extensible framework  

Properties

Propertyprotected  $intValidator= ''
Details
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct( ) : void

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate(  $value, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$value
$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_Font

Package: SugarCRM

Validates shorthand CSS property font.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertyprotected  $info= 'array()'

Local copy of component validators.

Default valuearray()Details
Type
n/a
Note
If we moved specific CSS property definitions to their own classes instead of having them be assembled at run time by CSSDefinition, this wouldn't be necessary. We'd instantiate our own copies.  
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct(  $config ) : void

Parameters
Name Type Description
$config
methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_FontFamily

Package: SugarCRM

Validates a font family list according to CSS spec

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertyprotected  $mask= 'null'
Default valuenullDetails
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct( ) : void

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_ImportantDecorator

Package: SugarCRM

Decorator which enables !important to be used in CSS values.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertypublic  $allow= ''
Details
Type
n/a
Propertypublic  $def= ''
Details
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct( \$def $def, \$allow $allow = false ) : void

Parameters
Name Type Description
$def \$def

Definition to wrap

$allow \$allow

Whether or not to allow !important

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Intercepts and removes !important if necessary

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_Length

Package: SugarCRM

Represents a Length as defined by CSS.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertypublic  $max= ''
Details
Type
n/a
Propertyprotected  $min= ''
Details
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct(  $min = null, \HTMLPurifier_Length | \HTMLPurifier_Length $max = null ) : void

Parameters
Name Type Description
$min
$max \HTMLPurifier_Length | \HTMLPurifier_Length

Minimum length, or null for no bound. String is also acceptable.

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_ListStyle

Package: SugarCRM

Validates shorthand CSS property list-style.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Warning
Does not support url tokens that have internal spaces.  

Properties

Propertyprotected  $info= ''

Local copy of component validators.

Details
Type
n/a
Note
See HTMLPurifier_AttrDef_CSS_Font::$info for a similar impl.  
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct(  $config ) : void

Parameters
Name Type Description
$config
methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_Multiple

Package: SugarCRM

Framework class for strings that involve multiple values.

Certain CSS properties such as border-width and margin allow multiple lengths to be specified. This class can take a vanilla border-width definition and multiply it, usually into a max of four.

Parent(s)
\HTMLPurifier_AttrDef
Note
Even though the CSS specification isn't clear about it, inherit can only be used alone: it will never manifest as part of a multi shorthand declaration. Thus, this class does not allow inherit.  

Properties

Propertypublic  $max= ''

Max number of values allowed.

Details
Type
n/a
Todo
Make protected  
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  
Propertypublic  $single= ''

Instance of component definition to defer validation to.

Details
Type
n/a
Todo
Make protected  

Methods

methodpublic__construct( \$single $single, \$max $max = 4 ) : void

Parameters
Name Type Description
$single \$single

HTMLPurifier_AttrDef to multiply

$max \$max

Max number of values allowed (usually four)

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_Number

Package: SugarCRM

Validates a number as defined by the CSS spec.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Children
\HTMLPurifier_AttrDef_CSS_AlphaValue

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertyprotected  $non_negative= 'false'

Bool indicating whether or not only positive values allowed.

Default valuefalseDetails
Type
n/a
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct( \$non_negative $non_negative = false ) : void

Parameters
Name Type Description
$non_negative \$non_negative

Bool indicating whether negatives are forbidden

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate(  $number, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$number
$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

Details
Warning
Some contexts do not pass $config, $context. These variables should not be used without checking HTMLPurifier_Length  

\HTMLPurifier_AttrDef_CSS_Percentage

Package: SugarCRM

Validates a Percentage as defined by the CSS spec.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertyprotected  $number_def= ''

Instance of HTMLPurifier_AttrDef_CSS_Number to defer number validation

Details
Type
n/a
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct( Bool $non_negative = false ) : void

Parameters
Name Type Description
$non_negative Bool

indicating whether to forbid negative values

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_TextDecoration

Package: SugarCRM

Validates the value for the CSS property text-decoration

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Note
This class could be generalized into a version that acts sort of like Enum except you can compound the allowed values.  

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_CSS_URI

Package: SugarCRM

Validates a URI in CSS syntax, which uses url('http://example.com')

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef_URI < \HTMLPurifier_AttrDef
Note
While theoretically speaking a URI in a CSS document could be non-embedded, as of CSS2 there is no such usage so we're generalizing it. This may need to be changed in the future.  
Warning
Since HTMLPurifier_AttrDef_CSS blindly uses semicolons as the separator, you cannot put a literal semicolon in in the URI. Try percent encoding it, in that case.  

Properties

Propertyprotected  $embedsResource= ''
Details
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef_URI::$$embedsResource  
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized\HTMLPurifier_AttrDef_URI::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Inherited_from
\HTMLPurifier_AttrDef_URI::$$minimized  
Propertyprotected  $parser= ''
inheritedInherited from: \HTMLPurifier_AttrDef_URI::$$parser
Details
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef_URI::$$parser  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required\HTMLPurifier_AttrDef_URI::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  
Inherited_from
\HTMLPurifier_AttrDef_URI::$$required  

Methods

methodpublic__construct( ) : void

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()\HTMLPurifier_AttrDef_URI::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef_URI::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()\HTMLPurifier_AttrDef_URI::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()\HTMLPurifier_AttrDef_URI::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate(  $uri_string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$uri_string
$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_Enum

Package: SugarCRM

Validates a keyword against a list of valid values.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Children
\HTMLPurifier_AttrDef_HTML_FrameTarget
Warning
The case-insensitive compare of this function uses PHP's built-in strtolower and ctype_lower functions, which may cause problems with international comparisons  

Properties

Propertyprotected  $case_sensitive= 'false'

Bool indicating whether or not enumeration is case sensitive.

Default valuefalseDetails
Type
n/a
Note
In general this is always case insensitive.  
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  
Propertypublic  $valid_values= 'array()'

Lookup table of valid values.

Default valuearray()Details
Type
n/a
Todo
Make protected  

Methods

methodpublic__construct( \$valid_values $valid_values = array(), \$case_sensitive $case_sensitive = false ) : void

Parameters
Name Type Description
$valid_values \$valid_values

List of valid values

$case_sensitive \$case_sensitive

Bool indicating whether or not case sensitive

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created

Factory method for creating this class from a string.

Parameters
Name Type Description
$string \$string

In form of comma-delimited list of case-insensitive valid values. Example: "foo,bar,baz". Prepend "s:" to make case sensitive

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_HTML_Bool

Package: SugarCRM

Validates a boolean attribute

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertypublic  $minimized= 'true'

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Default valuetrueDetails
Type
n/a
Propertyprotected  $name= ''
Details
Type
n/a
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct(  $name = false ) : void

Parameters
Name Type Description
$name
methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created

Factory method for creating this class from a string.

Parameters
Name Type Description
$string \$string

Name of attribute

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_HTML_Class

Package: SugarCRM

Implements special behavior for class attribute (normally NMTOKENS)

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef_HTML_Nmtokens < \HTMLPurifier_AttrDef

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized\HTMLPurifier_AttrDef_HTML_Nmtokens::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Inherited_from
\HTMLPurifier_AttrDef_HTML_Nmtokens::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required\HTMLPurifier_AttrDef_HTML_Nmtokens::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  
Inherited_from
\HTMLPurifier_AttrDef_HTML_Nmtokens::$$required  

Methods

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()\HTMLPurifier_AttrDef_HTML_Nmtokens::expandCSSEscape()
Parameters
Name Type Description
$string
methodprotectedfilter(  $tokens,  $config,  $context ) : void

Template method for removing certain tokens based on arbitrary criteria.

Parameters
Name Type Description
$tokens
$config
$context
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()\HTMLPurifier_AttrDef_HTML_Nmtokens::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()\HTMLPurifier_AttrDef_HTML_Nmtokens::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()\HTMLPurifier_AttrDef_HTML_Nmtokens::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodprotectedsplit(  $string,  $config,  $context ) : void

Splits a space separated list of tokens into its constituent parts.

Parameters
Name Type Description
$string
$config
$context
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void
inherited

Validates and cleans passed string according to a definition.

Inherited from: \HTMLPurifier_AttrDef_HTML_Nmtokens::validate()
Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_HTML_Color

Package: SugarCRM

Validates a color according to the HTML spec.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_HTML_FrameTarget

Package: SugarCRM

Special-case enum attribute definition that lazy loads allowed frame targets

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef_Enum < \HTMLPurifier_AttrDef

Properties

Propertyprotected  $case_sensitive= 'false'

Bool indicating whether or not enumeration is case sensitive.

Default valuefalseDetails
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized\HTMLPurifier_AttrDef_Enum::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Inherited_from
\HTMLPurifier_AttrDef_Enum::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required\HTMLPurifier_AttrDef_Enum::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  
Inherited_from
\HTMLPurifier_AttrDef_Enum::$$required  
Propertypublic  $valid_values= 'false'

Lookup table of valid values.

Default valuefalseDetails
Type
n/a

Methods

methodpublic__construct( ) : void

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()\HTMLPurifier_AttrDef_Enum::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef_Enum::make()
Parameters
Name Type Description
$string \$string

In form of comma-delimited list of case-insensitive valid values. Example: "foo,bar,baz". Prepend "s:" to make case sensitive

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()\HTMLPurifier_AttrDef_Enum::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()\HTMLPurifier_AttrDef_Enum::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_HTML_ID

Package: SugarCRM

Validates the HTML attribute ID.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Warning
Even though this is the id processor, it will ignore the directive Attr:IDBlacklist, since it will only go according to the ID accumulator. Since the accumulator is automatically generated, it will have already absorbed the blacklist. If you're hacking around, make sure you use load()!  

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate(  $id, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$id
$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_HTML_Length

Package: SugarCRM

Validates the HTML type length (not to be confused with CSS's length).

This accepts integer pixels or percentages as lengths for certain HTML attributes.

Parent(s)
\HTMLPurifier_AttrDef_HTML_Pixels < \HTMLPurifier_AttrDef
Children
\HTMLPurifier_AttrDef_HTML_MultiLength

Properties

Propertyprotected  $max= ''
inheritedInherited from: \HTMLPurifier_AttrDef_HTML_Pixels::$$max
Details
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef_HTML_Pixels::$$max  
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized\HTMLPurifier_AttrDef_HTML_Pixels::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Inherited_from
\HTMLPurifier_AttrDef_HTML_Pixels::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required\HTMLPurifier_AttrDef_HTML_Pixels::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  
Inherited_from
\HTMLPurifier_AttrDef_HTML_Pixels::$$required  

Methods

methodpublic__construct(  $max = null ) : void
Parameters
Name Type Description
$max
methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()\HTMLPurifier_AttrDef_HTML_Pixels::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef_HTML_Pixels::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()\HTMLPurifier_AttrDef_HTML_Pixels::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()\HTMLPurifier_AttrDef_HTML_Pixels::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_HTML_LinkTypes

Package: SugarCRM

Validates a rel/rev link attribute against a directive of allowed values

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Note
We cannot use Enum because link types allow multiple values.  
Note
Assumes link types are ASCII text  

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertyprotected  $name= ''

Name config attribute to pull.

Details
Type
n/a
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct(  $name ) : void

Parameters
Name Type Description
$name
methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_HTML_MultiLength

Package: SugarCRM

Validates a MultiLength as defined by the HTML spec.

A multilength is either a integer (pixel count), a percentage, or a relative number.

Parent(s)
\HTMLPurifier_AttrDef_HTML_Length < \HTMLPurifier_AttrDef_HTML_Pixels < \HTMLPurifier_AttrDef

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized\HTMLPurifier_AttrDef_HTML_Pixels::$$minimized\HTMLPurifier_AttrDef_HTML_Length::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Inherited_from
\HTMLPurifier_AttrDef_HTML_Pixels::$$minimized  
Inherited_from
\HTMLPurifier_AttrDef_HTML_Length::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required\HTMLPurifier_AttrDef_HTML_Pixels::$$required\HTMLPurifier_AttrDef_HTML_Length::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  
Inherited_from
\HTMLPurifier_AttrDef_HTML_Pixels::$$required  
Inherited_from
\HTMLPurifier_AttrDef_HTML_Length::$$required  

Methods

methodpublic__construct(  $max = null ) : void
Parameters
Name Type Description
$max
methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()\HTMLPurifier_AttrDef_HTML_Pixels::expandCSSEscape()\HTMLPurifier_AttrDef_HTML_Length::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef_HTML_Pixels::make()\HTMLPurifier_AttrDef_HTML_Length::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()\HTMLPurifier_AttrDef_HTML_Pixels::mungeRgb()\HTMLPurifier_AttrDef_HTML_Length::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()\HTMLPurifier_AttrDef_HTML_Pixels::parseCDATA()\HTMLPurifier_AttrDef_HTML_Length::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_HTML_Nmtokens

Package: SugarCRM

Validates contents based on NMTOKENS attribute type.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Children
\HTMLPurifier_AttrDef_HTML_Class

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodprotectedfilter(  $tokens,  $config,  $context ) : void

Template method for removing certain tokens based on arbitrary criteria.

Parameters
Name Type Description
$tokens
$config
$context
Details
Note
If we wanted to be really functional, we'd do an array_filter with a callback. But... we're not.  
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodprotectedsplit(  $string,  $config,  $context ) : void

Splits a space separated list of tokens into its constituent parts.

Parameters
Name Type Description
$string
$config
$context
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_HTML_Pixels

Package: SugarCRM

Validates an integer representation of pixels according to the HTML spec.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Children
\HTMLPurifier_AttrDef_HTML_Length

Properties

Propertyprotected  $max= ''
Details
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct(  $max = null ) : void

Parameters
Name Type Description
$max
methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created

Factory method for creating this class from a string.

Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_Integer

Package: SugarCRM

Validates an integer.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Note
While this class was modeled off the CSS definition, no currently allowed CSS uses this type. The properties that do are: widows, orphans, z-index, counter-increment, counter-reset. Some of the HTML attributes, however, find use for a non-negative version of this.  

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertyprotected  $negative= 'true'

Bool indicating whether or not negative values are allowed

Default valuetrueDetails
Type
n/a
Propertyprotected  $positive= 'true'

Bool indicating whether or not positive values are allowed

Default valuetrueDetails
Type
n/a
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  
Propertyprotected  $zero= 'true'

Bool indicating whether or not zero is allowed

Default valuetrueDetails
Type
n/a

Methods

methodpublic__construct( \$negative $negative = true, \$zero $zero = true, \$positive $positive = true ) : void

Parameters
Name Type Description
$negative \$negative

Bool indicating whether or not negative values are allowed

$zero \$zero

Bool indicating whether or not zero is allowed

$positive \$positive

Bool indicating whether or not positive values are allowed

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate(  $integer, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$integer
$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_Lang

Package: SugarCRM

Validates the HTML attribute lang, effectively a language code.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Note
Built according to RFC 3066, which obsoleted RFC 1766  

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_Switch

Package: SugarCRM

Decorator that, depending on a token, switches between two definitions.

Properties

Propertyprotected  $tag= ''
Details
Type
n/a
Propertyprotected  $withTag= ''
Details
Type
n/a
Propertypublic  $withoutTag= ''
Details
Type
n/a

Methods

methodpublic__construct( string $tag, \HTMLPurifier_AttrDef $with_tag, \HTMLPurifier_AttrDef $without_tag ) : void

Parameters
Name Type Description
$tag string

Tag name to switch upon

$with_tag \HTMLPurifier_AttrDef

Call if token matches tag

$without_tag \HTMLPurifier_AttrDef

Call if token doesn't match, or there is no token

methodpublicvalidate(  $string,  $config,  $context ) : void

Parameters
Name Type Description
$string
$config
$context

\HTMLPurifier_AttrDef_Text

Package: SugarCRM

Validates arbitrary text according to the HTML spec.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_URI

Package: SugarCRM

Validates a URI as defined by RFC 3986.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Children
\HTMLPurifier_AttrDef_CSS_URI
Note
Scheme-specific mechanics deferred to HTMLPurifier_URIScheme  

Properties

Propertyprotected  $embedsResource= ''
Details
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertyprotected  $parser= ''
Details
Type
n/a
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct( \$embeds_resource_resource $embeds_resource = false ) : void

Parameters
Name Type Description
$embeds_resource \$embeds_resource_resource

Does the URI here result in an extra HTTP request?

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created

Factory method for creating this class from a string.

Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate(  $uri, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$uri
$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_URI_Email

Package:

Base class for all validating attribute definitions.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Children
\HTMLPurifier_AttrDef_URI_Email_SimpleCheck

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicunpack(  $string ) : void

Unpacks a mailbox into its display-name and address

Parameters
Name Type Description
$string
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void
abstractinherited

Validates and cleans passed string according to a definition.

Inherited from: \HTMLPurifier_AttrDef::validate()
Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_URI_Email_SimpleCheck

Package: SugarCRM

Primitive email validation class based on the regexp found at http://www.regular-expressions.info/email.html

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef_URI_Email < \HTMLPurifier_AttrDef

Properties

Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized\HTMLPurifier_AttrDef_URI_Email::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Inherited_from
\HTMLPurifier_AttrDef_URI_Email::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required\HTMLPurifier_AttrDef_URI_Email::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  
Inherited_from
\HTMLPurifier_AttrDef_URI_Email::$$required  

Methods

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()\HTMLPurifier_AttrDef_URI_Email::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()\HTMLPurifier_AttrDef_URI_Email::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()\HTMLPurifier_AttrDef_URI_Email::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()\HTMLPurifier_AttrDef_URI_Email::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicunpack(  $string ) : void
inherited

Unpacks a mailbox into its display-name and address

Inherited from: \HTMLPurifier_AttrDef_URI_Email::unpack()
Parameters
Name Type Description
$string
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_URI_Host

Package: SugarCRM

Validates a host according to the IPv4, IPv6 and DNS (future) specifications.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef

Properties

Propertyprotected  $ipv4= ''

Instance of HTMLPurifier_AttrDef_URI_IPv4 sub-validator

Details
Type
n/a
Propertyprotected  $ipv6= ''

Instance of HTMLPurifier_AttrDef_URI_IPv6 sub-validator

Details
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodpublic__construct( ) : void

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate( \$string $string, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$string \$string

String to be validated and cleaned.

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_URI_IPv4

Package: SugarCRM

Validates an IPv4 address

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef
Children
\HTMLPurifier_AttrDef_URI_IPv6
Author
Feyd @ forums.devnetwork.net (public domain)  

Properties

Propertyprotected  $ip4= ''

IPv4 regex, protected so that IPv6 can reuse it

Details
Type
n/a
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  

Methods

methodprotected_loadRegex( ) : void

Lazy load function to prevent regex from being stuffed in cache.

methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate(  $aIP, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$aIP
$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrDef_URI_IPv6

Package: SugarCRM

Validates an IPv6 address.

This family of classes forms the core for not only HTML attribute validation, but also any sort of string that needs to be validated or cleaned (which means CSS properties and composite definitions are defined here too). Besides defining (through code) what precisely makes the string valid, subclasses are also responsible for cleaning the code if possible.

Parent(s)
\HTMLPurifier_AttrDef_URI_IPv4 < \HTMLPurifier_AttrDef
Author
Feyd @ forums.devnetwork.net (public domain)  
Note
This function requires brackets to have been removed from address in URI.  

Properties

Propertyprotected  $ip4= ''
inherited

IPv4 regex, protected so that IPv6 can reuse it

Inherited from: \HTMLPurifier_AttrDef_URI_IPv4::$$ip4
Details
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef_URI_IPv4::$$ip4  
Propertypublic  $minimized= 'false'
inherited

Tells us whether or not an HTML attribute is minimized. Has no meaning in other contexts.

Inherited from: \HTMLPurifier_AttrDef::$$minimized\HTMLPurifier_AttrDef_URI_IPv4::$$minimized
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$minimized  
Inherited_from
\HTMLPurifier_AttrDef_URI_IPv4::$$minimized  
Propertypublic  $required= 'false'
inherited

Tells us whether or not an HTML attribute is required. Has no meaning in other contexts

Inherited from: \HTMLPurifier_AttrDef::$$required\HTMLPurifier_AttrDef_URI_IPv4::$$required
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_AttrDef::$$required  
Inherited_from
\HTMLPurifier_AttrDef_URI_IPv4::$$required  

Methods

methodprotected_loadRegex( ) : void
inherited

Lazy load function to prevent regex from being stuffed in cache.

Inherited from: \HTMLPurifier_AttrDef_URI_IPv4::_loadRegex()
methodprotectedexpandCSSEscape(  $string ) : void
inherited

Parses a possibly escaped CSS string and returns the "pure" version of it.

Inherited from: \HTMLPurifier_AttrDef::expandCSSEscape()\HTMLPurifier_AttrDef_URI_IPv4::expandCSSEscape()
Parameters
Name Type Description
$string
methodpublicmake( \$string $string ) : \Created
inherited

Factory method for creating this class from a string.

Inherited from: \HTMLPurifier_AttrDef::make()\HTMLPurifier_AttrDef_URI_IPv4::make()
Parameters
Name Type Description
$string \$string

String construction info

Returns
Type Description
\Created AttrDef object corresponding to $string
methodprotectedmungeRgb(  $string ) : void
inherited

Removes spaces from rgb(0, 0, 0) so that shorthand CSS properties work properly. THIS IS A HACK!

Inherited from: \HTMLPurifier_AttrDef::mungeRgb()\HTMLPurifier_AttrDef_URI_IPv4::mungeRgb()
Parameters
Name Type Description
$string
methodpublicparseCDATA(  $string ) : void
inherited

Convenience method that parses a string as if it were CDATA.

Inherited from: \HTMLPurifier_AttrDef::parseCDATA()\HTMLPurifier_AttrDef_URI_IPv4::parseCDATA()

This method process a string in the manner specified at http://www.w3.org/TR/html4/types.html#h-6.2 by removing leading and trailing whitespace, ignoring line feeds, and replacing carriage returns and tabs with spaces. While most useful for HTML attributes specified as CDATA, it can also be applied to most CSS values.

Parameters
Name Type Description
$string
Details
Note
This method is not entirely standards compliant, as trim() removes more types of whitespace than specified in the spec. In practice, this is rarely a problem, as those extra characters usually have already been removed by HTMLPurifier_Encoder.  
Warning
This processing is inconsistent with XML's whitespace handling as specified by section 3.3.3 and referenced XHTML 1.0 section 4.7. However, note that we are NOT necessarily parsing XML, thus, this behavior may still be correct. We assume that newlines have been normalized.  
methodpublicvalidate(  $aIP, \$config $config, \$context $context ) : void

Validates and cleans passed string according to a definition.

Parameters
Name Type Description
$aIP
$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_AttrContext object.

\HTMLPurifier_AttrTransform

Package: SugarCRM

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.

Children
\HTMLPurifier_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_Textarea

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void

Retrieves and removes an attribute

Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void

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

Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void
abstract

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

Details
Returns
Processed attribute array.  

\HTMLPurifier_AttrTransform_Background

Package: SugarCRM

Pre-transform that changes proprietary background attribute to CSS.

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.

Parent(s)
\HTMLPurifier_AttrTransform

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_BdoDir

Package: SugarCRM

Post-trasnform that ensures that bdo tags have the dir attribute set.

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.

Parent(s)
\HTMLPurifier_AttrTransform

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_BgColor

Package: SugarCRM

Pre-transform that changes deprecated bgcolor attribute to CSS.

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.

Parent(s)
\HTMLPurifier_AttrTransform

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_BoolToCSS

Package: SugarCRM

Pre-transform that changes converts a boolean attribute to fixed CSS

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.

Parent(s)
\HTMLPurifier_AttrTransform

Properties

Propertyprotected  $attr= ''

Name of boolean attribute that is trigger

Details
Type
n/a
Propertyprotected  $css= ''

CSS declarations to add to style, needs trailing semicolon

Details
Type
n/a

Methods

methodpublic__construct( \$attr $attr, \$css $css ) : void

Parameters
Name Type Description
$attr \$attr

string attribute name to convert from

$css \$css

string CSS declarations to add to style (needs semicolon)

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_Border

Package: SugarCRM

Pre-transform that changes deprecated border attribute to CSS.

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.

Parent(s)
\HTMLPurifier_AttrTransform

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_EnumToCSS

Package: SugarCRM

Generic pre-transform that converts an attribute with a fixed number of values (enumerated) to CSS.

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.

Parent(s)
\HTMLPurifier_AttrTransform

Properties

Propertyprotected  $attr= ''

Name of attribute to transform from

Details
Type
n/a
Propertyprotected  $caseSensitive= 'false'

Case sensitivity of the matching

Default valuefalseDetails
Type
n/a
Warning
Currently can only be guaranteed to work with ASCII values.  
Propertyprotected  $enumToCSS= 'array()'

Lookup array of attribute values to CSS

Default valuearray()Details
Type
n/a

Methods

methodpublic__construct( \$attr $attr, \$enumToCSS $enum_to_css, \$case_sensitive $case_sensitive = false ) : void

Parameters
Name Type Description
$attr \$attr

String attribute name to transform from

$enum_to_css \$enumToCSS

Lookup array of attribute values to CSS

$case_sensitive \$case_sensitive

Boolean case sensitivity indicator, default false

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_ImgRequired

Package: SugarCRM

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.

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.

Parent(s)
\HTMLPurifier_AttrTransform

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_ImgSpace

Package: SugarCRM

Pre-transform that changes deprecated hspace and vspace attributes to CSS

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.

Parent(s)
\HTMLPurifier_AttrTransform

Properties

Propertyprotected  $attr= ''
Details
Type
n/a
Propertyprotected  $css= 'array( 'hspace' => array('left', 'right'), 'vspace' => array('top', 'bottom') )'
Default valuearray( 'hspace' => array('left', 'right'), 'vspace' => array('top', 'bottom') )Details
Type
n/a

Methods

methodpublic__construct(  $attr ) : void

Parameters
Name Type Description
$attr
methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_Input

Package: SugarCRM

Performs miscellaneous cross attribute validation and filtering for input elements. This is meant to be a post-transform.

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.

Parent(s)
\HTMLPurifier_AttrTransform

Properties

Propertyprotected  $pixels= ''
Details
Type
n/a

Methods

methodpublic__construct( ) : void

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_Lang

Package: SugarCRM

Post-transform that copies lang's value to xml:lang (and vice-versa)

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.

Parent(s)
\HTMLPurifier_AttrTransform
Note
Theoretically speaking, this could be a pre-transform, but putting post is more efficient.  

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_Length

Package: SugarCRM

Class for handling width/height length attribute transformations to CSS

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.

Parent(s)
\HTMLPurifier_AttrTransform

Properties

Propertyprotected  $cssName= ''
Details
Type
n/a
Propertyprotected  $name= ''
Details
Type
n/a

Methods

methodpublic__construct(  $name,  $css_name = null ) : void

Parameters
Name Type Description
$name
$css_name
methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_Name

Package: SugarCRM

Pre-transform that changes deprecated name attribute to ID if necessary

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.

Parent(s)
\HTMLPurifier_AttrTransform

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_NameSync

Package: SugarCRM

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.

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.

Parent(s)
\HTMLPurifier_AttrTransform

Methods

methodpublic__construct( ) : void

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_Nofollow

Package: SugarCRM

Adds rel="nofollow" to all outbound links. This transform is only attached if Attr.Nofollow is TRUE.

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.

Parent(s)
\HTMLPurifier_AttrTransform

Properties

Propertyprivate  $parser= ''
Details
Type
n/a

Methods

methodpublic__construct( ) : void

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_SafeEmbed

Package:

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.

Parent(s)
\HTMLPurifier_AttrTransform

Properties

Propertypublic  $name= '"SafeEmbed"'
Default value"SafeEmbed"Details
Type
n/a

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_SafeObject

Package: SugarCRM

Writes default type for all objects. Currently only supports flash.

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.

Parent(s)
\HTMLPurifier_AttrTransform

Properties

Propertypublic  $name= '"SafeObject"'
Default value"SafeObject"Details
Type
n/a

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_SafeParam

Package: SugarCRM

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.

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.

Parent(s)
\HTMLPurifier_AttrTransform
Note
This class only supports Flash. In the future, Quicktime support may be added.  
Warning
This class expects an injector to add the necessary parameters tags.  

Properties

Propertypublic  $name= '"SafeParam"'
Default value"SafeParam"Details
Type
n/a
Propertyprivate  $uri= ''
Details
Type
n/a

Methods

methodpublic__construct( ) : void

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_ScriptRequired

Package: SugarCRM

Implements required attribute stipulation for <script>

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.

Parent(s)
\HTMLPurifier_AttrTransform

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTransform_Textarea

Package: SugarCRM

Sets height/width defaults for <textarea>

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.

Parent(s)
\HTMLPurifier_AttrTransform

Methods

methodpublicconfiscateAttr( \$attr $attr, \$key $key ) : void
inherited

Retrieves and removes an attribute

Inherited from: \HTMLPurifier_AttrTransform::confiscateAttr()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$key \$key

Key of attribute to confiscate

methodpublicprependCSS( \$attr $attr, \$css $css ) : void
inherited

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

Inherited from: \HTMLPurifier_AttrTransform::prependCSS()
Parameters
Name Type Description
$attr \$attr

Attribute array to process (passed by reference)

$css \$css

CSS to prepend

methodpublictransform( \$attr $attr, \$config $config, \$context $context ) : void

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

Parameters
Name Type Description
$attr \$attr

Assoc array of attributes, usually from HTMLPurifier_Token_Tag::$attr

$config \$config

Mandatory HTMLPurifier_Config object.

$context \$context

Mandatory HTMLPurifier_Context object

\HTMLPurifier_AttrTypes

Package: SugarCRM

Provides lookup array of attribute types to HTMLPurifier_AttrDef objects

Properties

Propertyprotected  $info= 'array()'

Lookup array of attribute string identifiers to concrete implementations

Default valuearray()Details
Type
n/a

Methods

methodpublic__construct( ) : void

Constructs the info array, supplying default implementations for attribute types.

methodpublicget( \$type $type ) : Object

Retrieves a type

Parameters
Name Type Description
$type \$type

String type name

Returns
Type Description
Object AttrDef for type
methodpublicset( \$type $type, \$impl $impl ) : void

Sets a new implementation for a type

Parameters
Name Type Description
$type \$type

String type name

$impl \$impl

Object AttrDef for type

\HTMLPurifier_AttrValidator

Package: SugarCRM

Validates the attributes of a token. Doesn't manage required attributes very well. The only reason we factored this out was because RemoveForeignElements also needed it besides ValidateAttributes.

Methods

methodpublicvalidateToken( \$token $token, \$config $config, \$context $context ) : void

Validates the attributes of a token, returning a modified token that has valid tokens

Parameters
Name Type Description
$token \$token

Reference to token to validate. We require a reference because the operation this class performs on the token are not atomic, so the context CurrentToken to be updated throughout

$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

\HTMLPurifier_Bootstrap

Package: SugarCRM

Bootstrap class that contains meta-functionality for HTML Purifier such as the autoload function.

Note
This class may be used without any other files from HTML Purifier.  

Methods

methodpublicautoload( \$class $class ) : void
static

Autoload function for HTML Purifier

Parameters
Name Type Description
$class \$class

Class to load

methodpublicgetPath(  $class ) : void
static

Returns the path for a specific class.

Parameters
Name Type Description
$class
methodpublicregisterAutoload( ) : void
static

"Pre-registers" our autoloader on the SPL stack.

\HTMLPurifier_CSSDefinition

Package: SugarCRM

Defines allowed CSS attributes and what their values are.

Parent(s)
\HTMLPurifier_Definition
See
\HTMLPurifier_HTMLDefinition  

Properties

Propertypublic  $info= 'array()'

Assoc array of attribute name to definition object.

Default valuearray()Details
Type
n/a
Propertypublic  $optimized= 'null'
inherited

If true, write out the final definition object to the cache after setup. This will be true only if all invocations to get a raw definition object are also optimized. This does not cause file system thrashing because on subsequent calls the cached object is used and any writes to the raw definition object are short circuited. See enduser-customize.html for the high-level picture.

Inherited from: \HTMLPurifier_Definition::$$optimized
Default valuenullDetails
Type
n/a
Inherited_from
\HTMLPurifier_Definition::$$optimized  
Propertypublic  $setup= 'false'
inherited

Has setup() been called yet?

Inherited from: \HTMLPurifier_Definition::$$setup
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_Definition::$$setup  
Propertypublic  $type= ''CSS''

What type of definition is it?

Default value'CSS'Details
Type
n/a

Methods

methodprotecteddoSetup( \$config $config ) : void

Constructs the info array. The meat of this class.

Parameters
Name Type Description
$config \$config

HTMLPurifier_Config instance

methodprotecteddoSetupProprietary(  $config ) : void

Parameters
Name Type Description
$config
methodprotecteddoSetupTricky(  $config ) : void

Parameters
Name Type Description
$config
methodprotecteddoSetupTrusted(  $config ) : void

Parameters
Name Type Description
$config
methodpublicsetup( \$config $config ) : void
inherited

Setup function that aborts if already setup

Inherited from: \HTMLPurifier_Definition::setup()
Parameters
Name Type Description
$config \$config

HTMLPurifier_Config instance

methodprotectedsetupConfigStuff(  $config ) : void

Performs extra config-based processing. Based off of HTMLPurifier_HTMLDefinition.

Parameters
Name Type Description
$config
Details
Todo
Refactor duplicate elements into common class (probably using composition, not inheritance).  

\HTMLPurifier_ChildDef

Package: SugarCRM

Defines allowed child nodes and validates tokens against it.

Children
\HTMLPurifier_ChildDef_Chameleon
\HTMLPurifier_ChildDef_Custom
\HTMLPurifier_ChildDef_Empty
\HTMLPurifier_ChildDef_Required
\HTMLPurifier_ChildDef_Table

Properties

Propertypublic  $allow_empty= ''

Bool that indicates whether or not an empty array of children is okay

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

Details
Type
n/a
Propertypublic  $elements= 'array()'

Lookup array of all elements that this definition could possibly allow

Default valuearray()Details
Type
n/a
Propertypublic  $type= ''

Type of child definition, usually right-most part of class name lowercase.

Used occasionally in terms of context.

Details
Type
n/a

Methods

methodpublicgetAllowedElements(  $config ) : void

Get lookup of tag names that should not close this element automatically.

All other elements will do so.

Parameters
Name Type Description
$config
methodpublicvalidateChildren( \$tokens_of_children $tokens_of_children, \$config $config, \$context $context ) : boolboolarray
abstract

Validates nodes according to definition and returns modification.

Parameters
Name Type Description
$tokens_of_children \$tokens_of_children

Array of HTMLPurifier_Token

$config \$config

HTMLPurifier_Config object

$context \$context

HTMLPurifier_Context object

Returns
Type Description
boolboolarray true to leave nodes as isfalse to remove parent nodeof replacement child tokens

\HTMLPurifier_ChildDef_Chameleon

Package: SugarCRM

Definition that uses different definitions depending on context.

The del and ins tags are notable because they allow different types of elements depending on whether or not they're in a block or inline context. Chameleon allows this behavior to happen by using two different definitions depending on context. While this somewhat generalized, it is specifically intended for those two tags.

Parent(s)
\HTMLPurifier_ChildDef

Properties

Propertypublic  $allow_empty= ''
inherited

Bool that indicates whether or not an empty array of children is okay

Inherited from: \HTMLPurifier_ChildDef::$$allow_empty

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

Details
Type
n/a
Inherited_from
\HTMLPurifier_ChildDef::$$allow_empty  
Propertypublic  $block= ''

Instance of the definition object to use when block.

Details
Type
n/a
Propertypublic  $elements= 'array()'
inherited

Lookup array of all elements that this definition could possibly allow

Inherited from: \HTMLPurifier_ChildDef::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_ChildDef::$$elements  
Propertypublic  $inline= ''

Instance of the definition object to use when inline. Usually stricter.

Details
Type
n/a
Propertypublic  $type= ''chameleon''

Type of child definition, usually right-most part of class name lowercase.

Used occasionally in terms of context.

Default value'chameleon'Details
Type
n/a

Methods

methodpublic__construct( \$inline $inline, \$block $block ) : void

Parameters
Name Type Description
$inline \$inline

List of elements to allow when inline.

$block \$block

List of elements to allow when block.

methodpublicgetAllowedElements(  $config ) : void
inherited

Get lookup of tag names that should not close this element automatically.

Inherited from: \HTMLPurifier_ChildDef::getAllowedElements()

All other elements will do so.

Parameters
Name Type Description
$config
methodpublicvalidateChildren( \$tokens_of_children $tokens_of_children, \$config $config, \$context $context ) : boolboolarray

Validates nodes according to definition and returns modification.

Parameters
Name Type Description
$tokens_of_children \$tokens_of_children

Array of HTMLPurifier_Token

$config \$config

HTMLPurifier_Config object

$context \$context

HTMLPurifier_Context object

Returns
Type Description
boolboolarray true to leave nodes as isfalse to remove parent nodeof replacement child tokens

\HTMLPurifier_ChildDef_Custom

Package: SugarCRM

Custom validation class, accepts DTD child definitions

Parent(s)
\HTMLPurifier_ChildDef
Warning
Currently this class is an all or nothing proposition, that is, it will only give a bool return value.  

Properties

Propertyprivate  $_pcre_regex= ''

PCRE regex derived from $dtd_regex

Details
Type
n/a
Private
 
Propertypublic  $allow_empty= 'false'

Bool that indicates whether or not an empty array of children is okay

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

Default valuefalseDetails
Type
n/a
Propertypublic  $dtd_regex= ''

Allowed child pattern as defined by the DTD

Details
Type
n/a
Propertypublic  $elements= 'array()'
inherited

Lookup array of all elements that this definition could possibly allow

Inherited from: \HTMLPurifier_ChildDef::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_ChildDef::$$elements  
Propertypublic  $type= ''custom''

Type of child definition, usually right-most part of class name lowercase.

Used occasionally in terms of context.

Default value'custom'Details
Type
n/a

Methods

methodpublic__construct( \$dtd_regex $dtd_regex ) : void

Parameters
Name Type Description
$dtd_regex \$dtd_regex

Allowed child pattern from the DTD

methodprotected_compileRegex( ) : void

Compiles the PCRE regex from a DTD regex ($dtd_regex to $_pcre_regex)

methodpublicgetAllowedElements(  $config ) : void
inherited

Get lookup of tag names that should not close this element automatically.

Inherited from: \HTMLPurifier_ChildDef::getAllowedElements()

All other elements will do so.

Parameters
Name Type Description
$config
methodpublicvalidateChildren( \$tokens_of_children $tokens_of_children, \$config $config, \$context $context ) : boolboolarray

Validates nodes according to definition and returns modification.

Parameters
Name Type Description
$tokens_of_children \$tokens_of_children

Array of HTMLPurifier_Token

$config \$config

HTMLPurifier_Config object

$context \$context

HTMLPurifier_Context object

Returns
Type Description
boolboolarray true to leave nodes as isfalse to remove parent nodeof replacement child tokens

\HTMLPurifier_ChildDef_Empty

Package: SugarCRM

Definition that disallows all elements.

Parent(s)
\HTMLPurifier_ChildDef
Warning
validateChildren() in this class is actually never called, because empty elements are corrected in HTMLPurifier_Strategy_MakeWellFormed before child definitions are parsed in earnest by HTMLPurifier_Strategy_FixNesting.  

Properties

Propertypublic  $allow_empty= 'true'

Bool that indicates whether or not an empty array of children is okay

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

Default valuetrueDetails
Type
n/a
Propertypublic  $elements= 'array()'
inherited

Lookup array of all elements that this definition could possibly allow

Inherited from: \HTMLPurifier_ChildDef::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_ChildDef::$$elements  
Propertypublic  $type= ''empty''

Type of child definition, usually right-most part of class name lowercase.

Used occasionally in terms of context.

Default value'empty'Details
Type
n/a

Methods

methodpublic__construct( ) : void

methodpublicgetAllowedElements(  $config ) : void
inherited

Get lookup of tag names that should not close this element automatically.

Inherited from: \HTMLPurifier_ChildDef::getAllowedElements()

All other elements will do so.

Parameters
Name Type Description
$config
methodpublicvalidateChildren( \$tokens_of_children $tokens_of_children, \$config $config, \$context $context ) : boolboolarray

Validates nodes according to definition and returns modification.

Parameters
Name Type Description
$tokens_of_children \$tokens_of_children

Array of HTMLPurifier_Token

$config \$config

HTMLPurifier_Config object

$context \$context

HTMLPurifier_Context object

Returns
Type Description
boolboolarray true to leave nodes as isfalse to remove parent nodeof replacement child tokens

\HTMLPurifier_ChildDef_Optional

Package: SugarCRM

Definition that allows a set of elements, and allows no children.

Parent(s)
\HTMLPurifier_ChildDef_Required < \HTMLPurifier_ChildDef
Note
This is a hack to reuse code from HTMLPurifier_ChildDef_Required, really, one shouldn't inherit from the other. Only altered behavior is to overload a returned false with an array. Thus, it will never return false.  

Properties

Propertypublic  $allow_empty= 'true'

Bool that indicates whether or not an empty array of children is okay

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

Default valuetrueDetails
Type
n/a
Propertypublic  $elements= 'array()'
inherited

Lookup table of allowed elements.

Inherited from: \HTMLPurifier_ChildDef_Required::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_ChildDef_Required::$$elements  
Public
 
Propertypublic  $type= ''optional''

Type of child definition, usually right-most part of class name lowercase.

Used occasionally in terms of context.

Default value'optional'Details
Type
n/a
Propertyprotected  $whitespace= 'false'
inherited

Whether or not the last passed node was all whitespace.

Inherited from: \HTMLPurifier_ChildDef_Required::$$whitespace
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_ChildDef_Required::$$whitespace  

Methods

methodpublic__construct( \$elements $elements ) : void
Parameters
Name Type Description
$elements \$elements

List of allowed element names (lowercase).

methodpublicgetAllowedElements(  $config ) : void
inherited

Get lookup of tag names that should not close this element automatically.

Inherited from: \HTMLPurifier_ChildDef::getAllowedElements()\HTMLPurifier_ChildDef_Required::getAllowedElements()

All other elements will do so.

Parameters
Name Type Description
$config
methodpublicvalidateChildren( \$tokens_of_children $tokens_of_children, \$config $config, \$context $context ) : boolboolarray

Validates nodes according to definition and returns modification.

Parameters
Name Type Description
$tokens_of_children \$tokens_of_children

Array of HTMLPurifier_Token

$config \$config

HTMLPurifier_Config object

$context \$context

HTMLPurifier_Context object

Returns
Type Description
boolboolarray true to leave nodes as isfalse to remove parent nodeof replacement child tokens

\HTMLPurifier_ChildDef_Required

Package: SugarCRM

Definition that allows a set of elements, but disallows empty children.

Parent(s)
\HTMLPurifier_ChildDef
Children
\HTMLPurifier_ChildDef_Optional
\HTMLPurifier_ChildDef_StrictBlockquote

Properties

Propertypublic  $allow_empty= 'false'

Bool that indicates whether or not an empty array of children is okay

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

Default valuefalseDetails
Type
n/a
Propertypublic  $elements= 'array()'

Lookup table of allowed elements.

Default valuearray()Details
Type
n/a
Public
 
Propertypublic  $type= ''required''

Type of child definition, usually right-most part of class name lowercase.

Used occasionally in terms of context.

Default value'required'Details
Type
n/a
Propertyprotected  $whitespace= 'false'

Whether or not the last passed node was all whitespace.

Default valuefalseDetails
Type
n/a

Methods

methodpublic__construct( \$elements $elements ) : void

Parameters
Name Type Description
$elements \$elements

List of allowed element names (lowercase).

methodpublicgetAllowedElements(  $config ) : void
inherited

Get lookup of tag names that should not close this element automatically.

Inherited from: \HTMLPurifier_ChildDef::getAllowedElements()

All other elements will do so.

Parameters
Name Type Description
$config
methodpublicvalidateChildren( \$tokens_of_children $tokens_of_children, \$config $config, \$context $context ) : boolboolarray

Validates nodes according to definition and returns modification.

Parameters
Name Type Description
$tokens_of_children \$tokens_of_children

Array of HTMLPurifier_Token

$config \$config

HTMLPurifier_Config object

$context \$context

HTMLPurifier_Context object

Returns
Type Description
boolboolarray true to leave nodes as isfalse to remove parent nodeof replacement child tokens

\HTMLPurifier_ChildDef_StrictBlockquote

Package: SugarCRM

Takes the contents of blockquote when in strict and reformats for validation.

Parent(s)
\HTMLPurifier_ChildDef_Required < \HTMLPurifier_ChildDef

Properties

Propertypublic  $allow_empty= 'true'

Bool that indicates whether or not an empty array of children is okay

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

Default valuetrueDetails
Type
n/a
Propertypublic  $elements= 'array()'
inherited

Lookup table of allowed elements.

Inherited from: \HTMLPurifier_ChildDef_Required::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_ChildDef_Required::$$elements  
Public
 
Propertyprotected  $fake_elements= ''
Details
Type
n/a
Propertyprotected  $init= 'false'
Default valuefalseDetails
Type
n/a
Propertyprotected  $real_elements= ''
Details
Type
n/a
Propertypublic  $type= ''strictblockquote''

Type of child definition, usually right-most part of class name lowercase.

Used occasionally in terms of context.

Default value'strictblockquote'Details
Type
n/a
Propertyprotected  $whitespace= 'false'
inherited

Whether or not the last passed node was all whitespace.

Inherited from: \HTMLPurifier_ChildDef_Required::$$whitespace
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_ChildDef_Required::$$whitespace  

Methods

methodpublic__construct( \$elements $elements ) : void
Parameters
Name Type Description
$elements \$elements

List of allowed element names (lowercase).

methodpublicgetAllowedElements(  $config ) : void

Get lookup of tag names that should not close this element automatically.

All other elements will do so.

Parameters
Name Type Description
$config
Details
Note
We don't want MakeWellFormed to auto-close inline elements since they might be allowed.  
methodprivateinit(  $config ) : void

Parameters
Name Type Description
$config
methodpublicvalidateChildren( \$tokens_of_children $tokens_of_children, \$config $config, \$context $context ) : boolboolarray

Validates nodes according to definition and returns modification.

Parameters
Name Type Description
$tokens_of_children \$tokens_of_children

Array of HTMLPurifier_Token

$config \$config

HTMLPurifier_Config object

$context \$context

HTMLPurifier_Context object

Returns
Type Description
boolboolarray true to leave nodes as isfalse to remove parent nodeof replacement child tokens

\HTMLPurifier_ChildDef_Table

Package: SugarCRM

Definition for tables

Parent(s)
\HTMLPurifier_ChildDef

Properties

Propertypublic  $allow_empty= 'false'

Bool that indicates whether or not an empty array of children is okay

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

Default valuefalseDetails
Type
n/a
Propertypublic  $elements= 'array('tr' => true, 'tbody' => true, 'thead' => true, 'tfoot' => true, 'caption' => true, 'colgroup' => true, 'col' => true)'

Lookup array of all elements that this definition could possibly allow

Default valuearray('tr' => true, 'tbody' => true, 'thead' => true, 'tfoot' => true, 'caption' => true, 'colgroup' => true, 'col' => true)Details
Type
n/a
Propertypublic  $type= ''table''

Type of child definition, usually right-most part of class name lowercase.

Used occasionally in terms of context.

Default value'table'Details
Type
n/a

Methods

methodpublic__construct( ) : void

methodpublicgetAllowedElements(  $config ) : void
inherited

Get lookup of tag names that should not close this element automatically.

Inherited from: \HTMLPurifier_ChildDef::getAllowedElements()

All other elements will do so.

Parameters
Name Type Description
$config
methodpublicvalidateChildren( \$tokens_of_children $tokens_of_children, \$config $config, \$context $context ) : boolboolarray

Validates nodes according to definition and returns modification.

Parameters
Name Type Description
$tokens_of_children \$tokens_of_children

Array of HTMLPurifier_Token

$config \$config

HTMLPurifier_Config object

$context \$context

HTMLPurifier_Context object

Returns
Type Description
boolboolarray true to leave nodes as isfalse to remove parent nodeof replacement child tokens

\HTMLPurifier_Config

Package: SugarCRM

Configuration object that triggers customizable behavior.

Note
Many classes that could (although many times don't) use the configuration object make it a mandatory parameter. This is because a configuration object should always be forwarded, otherwise, you run the risk of missing a parameter and then being stumped when a configuration directive doesn't work.  
Todo
Reconsider some of the public member variables  
Warning
This class is strongly defined: that means that the class will fail if an undefined directive is retrieved or set.  

Properties

Propertyprivate  $aliasMode= ''

Whether or not a set is taking place due to an alias lookup.

Details
Type
n/a
Propertypublic  $autoFinalize= 'true'

Bool indicator whether or not to automatically finalize the object if a read operation is done

Default valuetrueDetails
Type
n/a
Propertypublic  $chatty= 'true'

Set to false if you do not want line and file numbers in errors (useful when unit testing). This will also compress some errors and exceptions.

Default valuetrueDetails
Type
n/a
Propertypublic  $def= ''

Reference HTMLPurifier_ConfigSchema for value checking

Details
Type
n/a
Note
This is public for introspective purposes. Please don't abuse!  
Propertyprotected  $definitions= ''

Indexed array of definitions

Details
Type
n/a
Propertyprotected  $finalized= 'false'

Bool indicator whether or not config is finalized

Default valuefalseDetails
Type
n/a
Propertyprivate  $lock= ''

Current lock; only gets to this namespace are allowed.

Details
Type
n/a
Propertyprotected  $parser= ''

Parser for variables

Details
Type
n/a
Propertyprotected  $plist= ''

Property list containing configuration directives.

Details
Type
n/a
Propertyprotected  $serial= ''

Serial for entire configuration object

Details
Type
n/a
Propertyprotected  $serials= 'array()'

Namespace indexed array of serials for specific namespaces (see getSerial() for more info).

Default valuearray()Details
Type
n/a
Propertypublic  $version= ''4.3.0''

HTML Purifier's version

Default value'4.3.0'Details
Type
n/a

Methods

methodpublic__construct( \$definition $definition,  $parent = null ) : void

Parameters
Name Type Description
$definition \$definition

HTMLPurifier_ConfigSchema that defines what directives are allowed.

$parent
methodprivate_listify(  $lookup ) : void

Convenience function for error reporting

Parameters
Name Type Description
$lookup
methodpublicautoFinalize( ) : void

Finalizes configuration only if auto finalize is on and not already finalized

methodpubliccreate( mixed $config, \HTMLPurifier_ConfigSchema $schema = null ) : \Configured
static

Convenience constructor that creates a config object based on a mixed var

Parameters
Name Type Description
$config mixed

Variable that defines the state of the config object. Can be: a HTMLPurifier_Config() object, an array of directives based on loadArray(), or a string filename of an ini file.

$schema \HTMLPurifier_ConfigSchema

Schema object

Returns
Type Description
\Configured HTMLPurifier_Config object
methodpubliccreateDefault( ) : \Default
static

Convenience constructor that creates a default configuration object.

Returns
Type Description
\Default HTMLPurifier_Config object.
methodpublicfinalize( ) : void

Finalizes a configuration object, prohibiting further change

methodpublicget( \$key $key,  $a = null ) : void

Retreives a value from the configuration.

Parameters
Name Type Description
$key \$key

String key

$a
methodpublicgetAll( ) : void

Retrieves all directives, organized by namespace

Details
Warning
This is a pretty inefficient function, avoid if you can  
methodpublicgetAllowedDirectivesForForm( \$allowed $allowed,  $schema = null ) : void
static

Returns a list of array(namespace, directive) for all directives that are allowed in a web-form context as per an allowed namespaces/directives list.

Parameters
Name Type Description
$allowed \$allowed

List of allowed namespaces/directives

$schema
methodpublicgetBatch( \$namespace $namespace ) : void

Retreives an array of directives to values from a given namespace

Parameters
Name Type Description
$namespace \$namespace

String namespace

methodpublicgetBatchSerial( \$namespace $namespace ) : void

Returns a md5 signature of a segment of the configuration object that uniquely identifies that particular configuration

Parameters
Name Type Description
$namespace \$namespace

Namespace to get serial for

Details
Note
Revision is handled specially and is removed from the batch before processing!  
methodpublicgetCSSDefinition( \$raw $raw = false, \$optimized $optimized = false ) : void

Retrieves object reference to the CSS definition

Parameters
Name Type Description
$raw \$raw

Return a copy that has not been setup yet. Must be called before it's been setup, otherwise won't work.

$optimized \$optimized

If true, this method may return null, to indicate that a cached version of the modified definition object is available and no further edits are necessary. Consider using maybeGetRawCSSDefinition, which is more explicitly named, instead.

methodpublicgetDefinition( \$type $type, \$raw $raw = false, \$optimized $optimized = false ) : void

Retrieves a definition

Parameters
Name Type Description
$type \$type

Type of definition: HTML, CSS, etc

$raw \$raw

Whether or not definition should be returned raw

$optimized \$optimized

Only has an effect when $raw is true. Whether or not to return null if the result is already present in the cache. This is off by default for backwards compatibility reasons, but you need to do things this way in order to ensure that caching is done properly. Check out enduser-customize.html for more details. We probably won't ever change this default, as much as the maybe semantics is the "right thing to do."

methodpublicgetHTMLDefinition( \$raw $raw = false, \$optimized $optimized = false ) : void

Retrieves object reference to the HTML definition.

Parameters
Name Type Description
$raw \$raw

Return a copy that has not been setup yet. Must be called before it's been setup, otherwise won't work.

$optimized \$optimized

If true, this method may return null, to indicate that a cached version of the modified definition object is available and no further edits are necessary. Consider using maybeGetRawHTMLDefinition, which is more explicitly named, instead.

methodpublicgetSerial( ) : void

Returns a md5 signature for the entire configuration object that uniquely identifies that particular configuration

methodpublicgetURIDefinition( \$raw $raw = false, \$optimized $optimized = false ) : void

Retrieves object reference to the URI definition

Parameters
Name Type Description
$raw \$raw

Return a copy that has not been setup yet. Must be called before it's been setup, otherwise won't work.

$optimized \$optimized

If true, this method may return null, to indicate that a cached version of the modified definition object is available and no further edits are necessary. Consider using maybeGetRawURIDefinition, which is more explicitly named, instead.

methodpublicinherit( \HTMLPurifier_Config $config ) : \HTMLPurifier_Config
static

Creates a new config object that inherits from a previous one.

Parameters
Name Type Description
$config \HTMLPurifier_Config

Configuration object to inherit from.

Returns
Type Description
\HTMLPurifier_Config object with $config as its parent.
methodprivateinitDefinition(  $type ) : void

Parameters
Name Type Description
$type
methodpublicisFinalized( \$error $error = false ) : void

Checks whether or not the configuration object is finalized.

Parameters
Name Type Description
$error \$error

String error message, or false for no error

methodpublicloadArray( \$config_array $config_array ) : void

Loads configuration values from an array with the following structure: Namespace.Directive => Value

Parameters
Name Type Description
$config_array \$config_array

Configuration associative array

methodpublicloadArrayFromForm(  $array, \$index $index = false, \$allowed $allowed = true, \$mq_fix $mq_fix = true, \$schema $schema = null ) : void
static

Loads configuration values from $_GET/$_POST that were posted via ConfigForm

Parameters
Name Type Description
$array
$index \$index

Index/name that the config variables are in

$allowed \$allowed

List of allowed namespaces/directives

$mq_fix \$mq_fix

Boolean whether or not to enable magic quotes fix

$schema \$schema

Instance of HTMLPurifier_ConfigSchema to use, if not global copy

methodpublicloadIni( \$filename $filename ) : void

Loads configuration values from an ini file

Parameters
Name Type Description
$filename \$filename

Name of ini file

methodpublicmaybeGetRawCSSDefinition( ) : void

methodpublicmaybeGetRawDefinition(  $name ) : void

Parameters
Name Type Description
$name
methodpublicmaybeGetRawHTMLDefinition( ) : void

methodpublicmaybeGetRawURIDefinition( ) : void

methodpublicmergeArrayFromForm(  $array,  $index = false,  $allowed = true,  $mq_fix = true ) : void

Merges in configuration values from $_GET/$_POST to object. NOT STATIC.

Parameters
Name Type Description
$array
$index
$allowed
$mq_fix
Details
Note
Same parameters as loadArrayFromForm  
methodpublicprepareArrayFromForm(  $array,  $index = false,  $allowed = true,  $mq_fix = true,  $schema = null ) : void
static

Prepares an array from a form into something usable for the more strict parts of HTMLPurifier_Config

Parameters
Name Type Description
$array
$index
$allowed
$mq_fix
$schema
methodpublicserialize( ) : void

Returns a serialized form of the configuration object that can be reconstituted.

methodpublicset( \$key $key, \$value $value,  $a = null ) : void

Sets a value to configuration.

Parameters
Name Type Description
$key \$key

String key

$value \$value

Mixed value

$a
methodprotectedtriggerError(  $msg,  $no ) : void

Produces a nicely formatted error message by supplying the stack frame information OUTSIDE of HTMLPurifier_Config.

Parameters
Name Type Description
$msg
$no

\HTMLPurifier_ConfigSchema

Package: SugarCRM

Configuration definition, defines directives and their defaults.

Properties

Propertypublic  $defaultPlist= ''

The default property list. Do not edit this property list.

Details
Type
n/a
Propertypublic  $defaults= 'array()'

Defaults of the directives and namespaces.

Default valuearray()Details
Type
n/a
Note
This shares the exact same structure as HTMLPurifier_Config::$conf  
Propertypublic  $info= 'array()'

Definition of the directives. The structure of this is:

array( 'Namespace' => array( 'Directive' => new stdclass(), ) )

The stdclass may have the following properties:

  • If isAlias isn't set:
    • type: Integer type of directive, see HTMLPurifier_VarParser for definitions
    • allow_null: If set, this directive allows null values
    • aliases: If set, an associative array of value aliases to real values
    • allowed: If set, a lookup array of allowed (string) values
  • If isAlias is set:
    • namespace: Namespace this directive aliases to
    • name: Directive name this directive aliases to

In certain degenerate cases, stdclass will actually be an integer. In that case, the value is equivalent to an stdclass with the type property set to the integer. If the integer is negative, type is equal to the absolute value of integer, and allow_null is true.

This class is friendly with HTMLPurifier_Config. If you need introspection about the schema, you're better of using the ConfigSchema_Interchange, which uses more memory but has much richer information.

Default valuearray()Details
Type
n/a
Propertyprotected  $singleton= ''
static

Application-wide singleton

Details
Type
n/a

Methods

methodpublic__construct( ) : void

methodpublicadd( \$namespace $key, \$name $default, \$default $type, \$type $allow_null ) : void

Defines a directive for configuration

Parameters
Name Type Description
$key \$namespace

Namespace the directive is in

$default \$name

Key of directive

$type \$default

Default value of directive

$allow_null \$type

Allowed type of the directive. See HTMLPurifier_DirectiveDef::$type for allowed values

Details
Warning
Will fail of directive's namespace is defined.  
Warning
This method's signature is slightly different from the legacy define() static method! Beware!  
methodpublicaddAlias(  $key, \$name $new_key ) : void

Defines a directive alias for backwards compatibility

Parameters
Name Type Description
$key
$new_key \$name

Directive that will be aliased

methodpublicaddAllowedValues( \$namespace $key, \$name $allowed ) : void

Defines a set of allowed values for a directive.

Parameters
Name Type Description
$key \$namespace

Namespace of directive

$allowed \$name

Name of directive

Details
Warning
This is slightly different from the corresponding static method definition.  
methodpublicaddValueAliases( \$namespace $key, \$name $aliases ) : void

Defines a directive value alias.

Directive value aliases are convenient for developers because it lets them set a directive to several values and get the same result.

Parameters
Name Type Description
$key \$namespace

Directive's namespace

$aliases \$name

Name of Directive

methodpublicinstance(  $prototype = null ) : void
static

Retrieves an instance of the application-wide configuration definition.

Parameters
Name Type Description
$prototype
methodpublicmakeFromSerial( ) : void
static

Unserializes the default ConfigSchema.

methodpublicpostProcess( ) : void

Replaces any stdclass that only has the type property with type integer.

\HTMLPurifier_ContentSets

Package: SugarCRM

Todo
Unit test  

Properties

Propertypublic  $info= 'array()'

List of content set strings (pipe seperators) indexed by name.

Default valuearray()Details
Type
n/a
Propertyprotected  $keys= 'array()'

Synchronized list of defined content sets (keys of info)

Default valuearray()Details
Type
n/a
Propertypublic  $lookup= 'array()'

List of content set lookups (element => true) indexed by name.

Default valuearray()Details
Type
n/a
Note
This is in HTMLPurifier_HTMLDefinition->info_content_sets  
Propertyprotected  $values= 'array()'

Synchronized list of defined content values (values of info)

Default valuearray()Details
Type
n/a

Methods

methodpublic__construct( \$modules $modules ) : void

Merges in module's content sets, expands identifiers in the content sets and populates the keys, values and lookup member variables.

Parameters
Name Type Description
$modules \$modules

List of HTMLPurifier_HTMLModule

methodprotectedconvertToLookup( \$string $string ) : \Lookup

Converts a string list of elements separated by pipes into a lookup array.

Parameters
Name Type Description
$string \$string

List of elements

Returns
Type Description
\Lookup array of elements
methodpublicgenerateChildDef( \$def $def, \$module $module ) : void

Accepts a definition; generates and assigns a ChildDef for it

Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef reference

$module \$module

Module that defined the ElementDef

methodpublicgenerateChildDefCallback(  $matches ) : void

Parameters
Name Type Description
$matches
methodpublicgetChildDef( \$def $def,  $module ) : \HTMLPurifier_ChildDef

Instantiates a ChildDef based on content_model and content_model_type member variables in HTMLPurifier_ElementDef

Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef to have ChildDef extracted

$module
Returns
Type Description
\HTMLPurifier_ChildDef corresponding to ElementDef
Details
Note
This will also defer to modules for custom HTMLPurifier_ChildDef subclasses that need content set expansion  

\HTMLPurifier_Context

Package: SugarCRM

Registry object that contains information about the current context.

Note
Since the variables Context deals with may not be objects, references are very important here! Do not remove!  
Warning
Is a bit buggy when variables are set to null: it thinks they don't exist! So use false instead, please.  

Properties

Propertyprivate  $_storage= 'array()'

Private array that stores the references.

Default valuearray()Details
Type
n/a

Methods

methodpublicdestroy( \$name $name ) : void

Destorys a variable in the context.

Parameters
Name Type Description
$name \$name

String name

methodpublicexists( \$name $name ) : void

Checks whether or not the variable exists.

Parameters
Name Type Description
$name \$name

String name

methodpublicget( \$name $name, \$ignore_error $ignore_error = false ) : void

Retrieves a variable reference from the context.

Parameters
Name Type Description
$name \$name

String name

$ignore_error \$ignore_error

Boolean whether or not to ignore error

methodpublicloadArray( \$context_array $context_array ) : void

Loads a series of variables from an associative array

Parameters
Name Type Description
$context_array \$context_array

Assoc array of variables to load

methodpublicregister( \$name $name, \$ref $ref ) : void

Registers a variable into the context.

Parameters
Name Type Description
$name \$name

String name

$ref \$ref

Reference to variable to be registered

\HTMLPurifier_Definition

Package: SugarCRM

Super-class for definition datatype objects, implements serialization functions for the class.

Children
\HTMLPurifier_CSSDefinition
\HTMLPurifier_HTMLDefinition
\HTMLPurifier_URIDefinition

Properties

Propertypublic  $optimized= 'null'

If true, write out the final definition object to the cache after setup. This will be true only if all invocations to get a raw definition object are also optimized. This does not cause file system thrashing because on subsequent calls the cached object is used and any writes to the raw definition object are short circuited. See enduser-customize.html for the high-level picture.

Default valuenullDetails
Type
n/a
Propertypublic  $setup= 'false'

Has setup() been called yet?

Default valuefalseDetails
Type
n/a
Propertypublic  $type= ''

What type of definition is it?

Details
Type
n/a

Methods

methodprotecteddoSetup( \$config $config ) : void
abstract

Sets up the definition object into the final form, something not done by the constructor

Parameters
Name Type Description
$config \$config

HTMLPurifier_Config instance

methodpublicsetup( \$config $config ) : void

Setup function that aborts if already setup

Parameters
Name Type Description
$config \$config

HTMLPurifier_Config instance

\HTMLPurifier_DefinitionCache

Package: SugarCRM

Abstract class representing Definition cache managers that implements useful common methods and is a factory.

Children
\HTMLPurifier_DefinitionCache_Decorator
\HTMLPurifier_DefinitionCache_Null
\HTMLPurifier_DefinitionCache_Serializer
Todo
Create a separate maintenance file advanced users can use to cache their custom HTMLDefinition, which can be loaded via a configuration directive  
Todo
Implement memcached  

Properties

Propertypublic  $type= ''
Details
Type
n/a

Methods

methodpublic__construct( \$name $type ) : void

Parameters
Name Type Description
$type \$name

Type of definition objects this instance of the cache will handle.

methodpublicadd(  $def,  $config ) : void
abstract

Adds a definition object to the cache

Parameters
Name Type Description
$def
$config
methodpubliccheckDefType( \$def $def ) : Boolean

Checks if a definition's type jives with the cache's type

Parameters
Name Type Description
$def \$def

Definition object to check

Returns
Type Description
Boolean true if good, false if not
Details
Note
Throws an error on failure  
methodpubliccleanup(  $config ) : void
abstract

Clears all expired (older version or revision) objects from cache

Parameters
Name Type Description
$config
Details
Note
Be carefuly implementing this method as flush. Flush must not interfere with other Definition types, and cleanup() should not be repeatedly called by userland code.  
methodpublicflush(  $config ) : void
abstract

Clears all objects from cache

Parameters
Name Type Description
$config
methodpublicgenerateKey( \Instance $config ) : void

Generates a unique identifier for a particular configuration

Parameters
Name Type Description
$config \Instance

of HTMLPurifier_Config

methodpublicget(  $config ) : void
abstract

Retrieves a definition object from the cache

Parameters
Name Type Description
$config
methodpublicisOld( \$key $key, \$config $config ) : void

Tests whether or not a key is old with respect to the configuration's version and revision number.

Parameters
Name Type Description
$key \$key

Key to test

$config \$config

Instance of HTMLPurifier_Config to test against

methodpublicremove(  $config ) : void
abstract

Removes a definition object to the cache

Parameters
Name Type Description
$config
methodpublicreplace(  $def,  $config ) : void
abstract

Replace an object in the cache

Parameters
Name Type Description
$def
$config
methodpublicset(  $def,  $config ) : void
abstract

Unconditionally saves a definition object to the cache

Parameters
Name Type Description
$def
$config

\HTMLPurifier_DefinitionCacheFactory

Package: SugarCRM

Responsible for creating definition caches.

Properties

Propertyprotected  $caches= 'array('Serializer' => array())'
Default valuearray('Serializer' => array())Details
Type
n/a
Propertyprotected  $decorators= 'array()'
Default valuearray()Details
Type
n/a
Propertyprotected  $implementations= 'array()'
Default valuearray()Details
Type
n/a

Methods

methodpublicaddDecorator(  $decorator ) : void

Registers a decorator to add to all new cache objects

Parameters
Name Type Description
$decorator
methodpubliccreate( \$name $type, \$config $config ) : void

Factory method that creates a cache object based on configuration

Parameters
Name Type Description
$type \$name

Name of definitions handled by cache

$config \$config

Instance of HTMLPurifier_Config

methodpublicinstance(  $prototype = null ) : void
static

Retrieves an instance of global definition cache factory.

Parameters
Name Type Description
$prototype
methodpublicregister( \$short $short, \$long $long ) : void

Registers a new definition cache object

Parameters
Name Type Description
$short \$short

Short name of cache object, for reference

$long \$long

Full class name of cache object, for construction

methodpublicsetup( ) : void

Initialize default decorators

\HTMLPurifier_DefinitionCache_Decorator

Package:

Abstract class representing Definition cache managers that implements useful common methods and is a factory.

Parent(s)
\HTMLPurifier_DefinitionCache
Children
\HTMLPurifier_DefinitionCache_Decorator_Cleanup
\HTMLPurifier_DefinitionCache_Decorator_Memory

Properties

Propertypublic  $cache= ''

Cache object we are decorating

Details
Type
n/a
Propertypublic  $type= ''
inheritedInherited from: \HTMLPurifier_DefinitionCache::$$type
Details
Type
n/a
Inherited_from
\HTMLPurifier_DefinitionCache::$$type  

Methods

methodpublic__construct( ) : void

methodpublicadd(  $def,  $config ) : void

Adds a definition object to the cache

Parameters
Name Type Description
$def
$config
methodpubliccheckDefType( \$def $def ) : Boolean
inherited

Checks if a definition's type jives with the cache's type

Inherited from: \HTMLPurifier_DefinitionCache::checkDefType()
Parameters
Name Type Description
$def \$def

Definition object to check

Returns
Type Description
Boolean true if good, false if not
Details
Note
Throws an error on failure  
methodpubliccleanup(  $config ) : void

Clears all expired (older version or revision) objects from cache

Parameters
Name Type Description
$config
methodpubliccopy( ) : void

Cross-compatible clone substitute

methodpublicdecorate( \$cache $cache ) : void

Lazy decorator function

Parameters
Name Type Description
$cache \$cache

Reference to cache object to decorate

methodpublicflush(  $config ) : void

Clears all objects from cache

Parameters
Name Type Description
$config
methodpublicgenerateKey( \Instance $config ) : void
inherited

Generates a unique identifier for a particular configuration

Inherited from: \HTMLPurifier_DefinitionCache::generateKey()
Parameters
Name Type Description
$config \Instance

of HTMLPurifier_Config

methodpublicget(  $config ) : void

Retrieves a definition object from the cache

Parameters
Name Type Description
$config
methodpublicisOld( \$key $key, \$config $config ) : void
inherited

Tests whether or not a key is old with respect to the configuration's version and revision number.

Inherited from: \HTMLPurifier_DefinitionCache::isOld()
Parameters
Name Type Description
$key \$key

Key to test

$config \$config

Instance of HTMLPurifier_Config to test against

methodpublicremove(  $config ) : void

Removes a definition object to the cache

Parameters
Name Type Description
$config
methodpublicreplace(  $def,  $config ) : void

Replace an object in the cache

Parameters
Name Type Description
$def
$config
methodpublicset(  $def,  $config ) : void

Unconditionally saves a definition object to the cache

Parameters
Name Type Description
$def
$config

\HTMLPurifier_DefinitionCache_Decorator_Cleanup

Package: SugarCRM

Definition cache decorator class that cleans up the cache whenever there is a cache miss.

Parent(s)
\HTMLPurifier_DefinitionCache_Decorator < \HTMLPurifier_DefinitionCache

Properties

Propertypublic  $cache= ''
inherited

Cache object we are decorating

Inherited from: \HTMLPurifier_DefinitionCache_Decorator::$$cache
Details
Type
n/a
Inherited_from
\HTMLPurifier_DefinitionCache_Decorator::$$cache  
Propertypublic  $name= ''Cleanup''
Default value'Cleanup'Details
Type
n/a

Methods

methodpublic__construct( ) : void
methodpublicadd(  $def,  $config ) : void

Adds a definition object to the cache

Parameters
Name Type Description
$def
$config
methodpubliccheckDefType( \$def $def ) : Boolean
inherited

Checks if a definition's type jives with the cache's type

Inherited from: \HTMLPurifier_DefinitionCache::checkDefType()\HTMLPurifier_DefinitionCache_Decorator::checkDefType()
Parameters
Name Type Description
$def \$def

Definition object to check

Returns
Type Description
Boolean true if good, false if not
Details
Note
Throws an error on failure  
methodpubliccleanup(  $config ) : void
inherited

Clears all expired (older version or revision) objects from cache

Inherited from: \HTMLPurifier_DefinitionCache_Decorator::cleanup()
Parameters
Name Type Description
$config
methodpubliccopy( ) : void

Cross-compatible clone substitute

methodpublicdecorate( \$cache $cache ) : void
inherited

Lazy decorator function

Inherited from: \HTMLPurifier_DefinitionCache_Decorator::decorate()
Parameters
Name Type Description
$cache \$cache

Reference to cache object to decorate

methodpublicflush(  $config ) : void
inherited

Clears all objects from cache

Inherited from: \HTMLPurifier_DefinitionCache_Decorator::flush()
Parameters
Name Type Description
$config
methodpublicgenerateKey( \Instance $config ) : void
inherited

Generates a unique identifier for a particular configuration

Inherited from: \HTMLPurifier_DefinitionCache::generateKey()\HTMLPurifier_DefinitionCache_Decorator::generateKey()
Parameters
Name Type Description
$config \Instance

of HTMLPurifier_Config

methodpublicget(  $config ) : void

Retrieves a definition object from the cache

Parameters
Name Type Description
$config
methodpublicisOld( \$key $key, \$config $config ) : void
inherited

Tests whether or not a key is old with respect to the configuration's version and revision number.

Inherited from: \HTMLPurifier_DefinitionCache::isOld()\HTMLPurifier_DefinitionCache_Decorator::isOld()
Parameters
Name Type Description
$key \$key

Key to test

$config \$config

Instance of HTMLPurifier_Config to test against

methodpublicremove(  $config ) : void
inherited

Removes a definition object to the cache

Inherited from: \HTMLPurifier_DefinitionCache_Decorator::remove()
Parameters
Name Type Description
$config
methodpublicreplace(  $def,  $config ) : void

Replace an object in the cache

Parameters
Name Type Description
$def
$config
methodpublicset(  $def,  $config ) : void

Unconditionally saves a definition object to the cache

Parameters
Name Type Description
$def
$config

\HTMLPurifier_DefinitionCache_Decorator_Memory

Package: SugarCRM

Definition cache decorator class that saves all cache retrievals to PHP's memory; good for unit tests or circumstances where there are lots of configuration objects floating around.

Parent(s)
\HTMLPurifier_DefinitionCache_Decorator < \HTMLPurifier_DefinitionCache

Properties

Propertypublic  $cache= ''
inherited

Cache object we are decorating

Inherited from: \HTMLPurifier_DefinitionCache_Decorator::$$cache
Details
Type
n/a
Inherited_from
\HTMLPurifier_DefinitionCache_Decorator::$$cache  
Propertyprotected  $definitions= ''
Details
Type
n/a
Propertypublic  $name= ''Memory''
Default value'Memory'Details
Type
n/a

Methods

methodpublic__construct( ) : void
methodpublicadd(  $def,  $config ) : void

Adds a definition object to the cache

Parameters
Name Type Description
$def
$config
methodpubliccheckDefType( \$def $def ) : Boolean
inherited

Checks if a definition's type jives with the cache's type

Inherited from: \HTMLPurifier_DefinitionCache::checkDefType()\HTMLPurifier_DefinitionCache_Decorator::checkDefType()
Parameters
Name Type Description
$def \$def

Definition object to check

Returns
Type Description
Boolean true if good, false if not
Details
Note
Throws an error on failure  
methodpubliccleanup(  $config ) : void
inherited

Clears all expired (older version or revision) objects from cache

Inherited from: \HTMLPurifier_DefinitionCache_Decorator::cleanup()
Parameters
Name Type Description
$config
methodpubliccopy( ) : void

Cross-compatible clone substitute

methodpublicdecorate( \$cache $cache ) : void
inherited

Lazy decorator function

Inherited from: \HTMLPurifier_DefinitionCache_Decorator::decorate()
Parameters
Name Type Description
$cache \$cache

Reference to cache object to decorate

methodpublicflush(  $config ) : void
inherited

Clears all objects from cache

Inherited from: \HTMLPurifier_DefinitionCache_Decorator::flush()
Parameters
Name Type Description
$config
methodpublicgenerateKey( \Instance $config ) : void
inherited

Generates a unique identifier for a particular configuration

Inherited from: \HTMLPurifier_DefinitionCache::generateKey()\HTMLPurifier_DefinitionCache_Decorator::generateKey()
Parameters
Name Type Description
$config \Instance

of HTMLPurifier_Config

methodpublicget(  $config ) : void

Retrieves a definition object from the cache

Parameters
Name Type Description
$config
methodpublicisOld( \$key $key, \$config $config ) : void
inherited

Tests whether or not a key is old with respect to the configuration's version and revision number.

Inherited from: \HTMLPurifier_DefinitionCache::isOld()\HTMLPurifier_DefinitionCache_Decorator::isOld()
Parameters
Name Type Description
$key \$key

Key to test

$config \$config

Instance of HTMLPurifier_Config to test against

methodpublicremove(  $config ) : void
inherited

Removes a definition object to the cache

Inherited from: \HTMLPurifier_DefinitionCache_Decorator::remove()
Parameters
Name Type Description
$config
methodpublicreplace(  $def,  $config ) : void

Replace an object in the cache

Parameters
Name Type Description
$def
$config
methodpublicset(  $def,  $config ) : void

Unconditionally saves a definition object to the cache

Parameters
Name Type Description
$def
$config

\HTMLPurifier_DefinitionCache_Null

Package: SugarCRM

Null cache object to use when no caching is on.

Parent(s)
\HTMLPurifier_DefinitionCache

Properties

Propertypublic  $type= ''
inheritedInherited from: \HTMLPurifier_DefinitionCache::$$type
Details
Type
n/a
Inherited_from
\HTMLPurifier_DefinitionCache::$$type  

Methods

methodpublic__construct( \$name $type ) : void
Parameters
Name Type Description
$type \$name

Type of definition objects this instance of the cache will handle.

methodpublicadd(  $def,  $config ) : void

Adds a definition object to the cache

Parameters
Name Type Description
$def
$config
methodpubliccheckDefType( \$def $def ) : Boolean
inherited

Checks if a definition's type jives with the cache's type

Inherited from: \HTMLPurifier_DefinitionCache::checkDefType()
Parameters
Name Type Description
$def \$def

Definition object to check

Returns
Type Description
Boolean true if good, false if not
Details
Note
Throws an error on failure  
methodpubliccleanup(  $config ) : void

Clears all expired (older version or revision) objects from cache

Parameters
Name Type Description
$config
methodpublicflush(  $config ) : void

Clears all objects from cache

Parameters
Name Type Description
$config
methodpublicgenerateKey( \Instance $config ) : void
inherited

Generates a unique identifier for a particular configuration

Inherited from: \HTMLPurifier_DefinitionCache::generateKey()
Parameters
Name Type Description
$config \Instance

of HTMLPurifier_Config

methodpublicget(  $config ) : void

Retrieves a definition object from the cache

Parameters
Name Type Description
$config
methodpublicisOld( \$key $key, \$config $config ) : void
inherited

Tests whether or not a key is old with respect to the configuration's version and revision number.

Inherited from: \HTMLPurifier_DefinitionCache::isOld()
Parameters
Name Type Description
$key \$key

Key to test

$config \$config

Instance of HTMLPurifier_Config to test against

methodpublicremove(  $config ) : void

Removes a definition object to the cache

Parameters
Name Type Description
$config
methodpublicreplace(  $def,  $config ) : void

Replace an object in the cache

Parameters
Name Type Description
$def
$config
methodpublicset(  $def,  $config ) : void

Unconditionally saves a definition object to the cache

Parameters
Name Type Description
$def
$config

\HTMLPurifier_DefinitionCache_Serializer

Package:

Abstract class representing Definition cache managers that implements useful common methods and is a factory.

Parent(s)
\HTMLPurifier_DefinitionCache

Properties

Propertypublic  $type= ''
inheritedInherited from: \HTMLPurifier_DefinitionCache::$$type
Details
Type
n/a
Inherited_from
\HTMLPurifier_DefinitionCache::$$type  

Methods

methodpublic__construct( \$name $type ) : void
Parameters
Name Type Description
$type \$name

Type of definition objects this instance of the cache will handle.

methodprivate_prepareDir( \$config $config ) : True

Prepares the directory that this type stores the serials in

Parameters
Name Type Description
$config \$config

Config object

Returns
Type Description
True if successful
methodprivate_testPermissions( \$dir $dir, \$chmod $chmod ) : True

Tests permissions on a directory and throws out friendly error messages and attempts to chmod it itself if possible

Parameters
Name Type Description
$dir \$dir

Directory path

$chmod \$chmod

Permissions

Returns
Type Description
True if directory writable
methodprivate_write( \$file $file, \$data $data, \$config $config ) : \Number

Convenience wrapper function for file_put_contents

Parameters
Name Type Description
$file \$file

File name to write to

$data \$data

Data to write into file

$config \$config

Config object

Returns
Type Description
\Number of bytes written if success, or false if failure.
methodpublicadd(  $def,  $config ) : void

Adds a definition object to the cache

Parameters
Name Type Description
$def
$config
methodpubliccheckDefType( \$def $def ) : Boolean
inherited

Checks if a definition's type jives with the cache's type

Inherited from: \HTMLPurifier_DefinitionCache::checkDefType()
Parameters
Name Type Description
$def \$def

Definition object to check

Returns
Type Description
Boolean true if good, false if not
Details
Note
Throws an error on failure  
methodpubliccleanup(  $config ) : void

Clears all expired (older version or revision) objects from cache

Parameters
Name Type Description
$config
methodpublicflush(  $config ) : void

Clears all objects from cache

Parameters
Name Type Description
$config
methodpublicgenerateBaseDirectoryPath(  $config ) : void

Generates path to base directory that contains all definition type serials

Parameters
Name Type Description
$config
Details
Todo
Make protected  
methodpublicgenerateDirectoryPath(  $config ) : void

Generates the path to the directory contain this cache's serial files

Parameters
Name Type Description
$config
Details
Note
No trailing slash  
Todo
Make protected  
methodpublicgenerateFilePath(  $config ) : void

Generates the file path to the serial file corresponding to the configuration and definition name

Parameters
Name Type Description
$config
Details
Todo
Make protected  
methodpublicgenerateKey( \Instance $config ) : void
inherited

Generates a unique identifier for a particular configuration

Inherited from: \HTMLPurifier_DefinitionCache::generateKey()
Parameters
Name Type Description
$config \Instance

of HTMLPurifier_Config

methodpublicget(  $config ) : void

Retrieves a definition object from the cache

Parameters
Name Type Description
$config
methodpublicisOld( \$key $key, \$config $config ) : void
inherited

Tests whether or not a key is old with respect to the configuration's version and revision number.

Inherited from: \HTMLPurifier_DefinitionCache::isOld()
Parameters
Name Type Description
$key \$key

Key to test

$config \$config

Instance of HTMLPurifier_Config to test against

methodpublicremove(  $config ) : void

Removes a definition object to the cache

Parameters
Name Type Description
$config
methodpublicreplace(  $def,  $config ) : void

Replace an object in the cache

Parameters
Name Type Description
$def
$config
methodpublicset(  $def,  $config ) : void

Unconditionally saves a definition object to the cache

Parameters
Name Type Description
$def
$config

\HTMLPurifier_Doctype

Package: SugarCRM

Represents a document type, contains information on which modules need to be loaded.

Note
This class is inspected by Printer_HTMLDefinition->renderDoctype. If structure changes, please update that function.  

Properties

Propertypublic  $aliases= 'array()'

List of aliases for this doctype

Default valuearray()Details
Type
n/a
Propertypublic  $dtdPublic= ''

Public DTD identifier

Details
Type
n/a
Propertypublic  $dtdSystem= ''

System DTD identifier

Details
Type
n/a
Propertypublic  $modules= 'array()'

List of standard modules (string identifiers or literal objects) that this doctype uses

Default valuearray()Details
Type
n/a
Propertypublic  $name= ''

Full name of doctype

Details
Type
n/a
Propertypublic  $tidyModules= 'array()'

List of modules to use for tidying up code

Default valuearray()Details
Type
n/a
Propertypublic  $xml= 'true'

Is the language derived from XML (i.e. XHTML)?

Default valuetrueDetails
Type
n/a

Methods

methodpublic__construct(  $name = null,  $xml = true,  $modules = array(),  $tidyModules = array(),  $aliases = array(),  $dtd_public = null,  $dtd_system = null ) : void

Parameters
Name Type Description
$name
$xml
$modules
$tidyModules
$aliases
$dtd_public
$dtd_system

\HTMLPurifier_DoctypeRegistry

Package:

Properties

Propertyprotected  $aliases= ''

Lookup table of aliases to real doctype names

Details
Type
n/a
Propertyprotected  $doctypes= ''

Hash of doctype names to doctype objects

Details
Type
n/a

Methods

methodpublicget( \$doctype $doctype ) : \Editable

Retrieves reference to a doctype of a certain name

Parameters
Name Type Description
$doctype \$doctype

Name of doctype

Returns
Type Description
\Editable doctype object
Details
Note
This function resolves aliases  
Note
When possible, use the more fully-featured make()  
methodpublicgetDoctypeFromConfig(  $config ) : void

Retrieves the doctype from the configuration object

Parameters
Name Type Description
$config
methodpublicmake(  $config ) : void

Creates a doctype based on a configuration object, will perform initialization on the doctype

Parameters
Name Type Description
$config
Details
Note
Use this function to get a copy of doctype that config can hold on to (this is necessary in order to tell Generator whether or not the current document is XML based or not).  
methodpublicregister( \$doctype $doctype, \$modules $xml = true, \$modules_for_modes $modules = array(), \$aliases $tidy_modules = array(),  $aliases = array(),  $dtd_public = null,  $dtd_system = null ) : \Editable

Registers a doctype to the registry

Parameters
Name Type Description
$doctype \$doctype

Name of doctype or literal doctype object

$xml \$modules

Modules doctype will load

$modules \$modules_for_modes

Modules doctype will load for certain modes

$tidy_modules \$aliases

Alias names for doctype

$aliases
$dtd_public
$dtd_system
Returns
Type Description
\Editable registered doctype
Details
Note
Accepts a fully-formed doctype object, or the parameters for constructing a doctype object  

\HTMLPurifier_ElementDef

Package: SugarCRM

Structure that stores an HTML element definition. Used by HTMLPurifier_HTMLDefinition and HTMLPurifier_HTMLModule.

Note
This class is inspected by HTMLPurifier_Printer_HTMLDefinition. Please update that class too.  
Warning
If you add new properties to this class, you MUST update the mergeIn() method.  

Properties

Propertypublic  $attr= 'array()'

Associative array of attribute name to HTMLPurifier_AttrDef

Default valuearray()Details
Type
n/a
Note
Before being processed by HTMLPurifier_AttrCollections when modules are finalized during HTMLPurifier_HTMLDefinition->setup(), this array may also contain an array at index 0 that indicates which attribute collections to load into the full array. It may also contain string indentifiers in lieu of HTMLPurifier_AttrDef, see HTMLPurifier_AttrTypes on how they are expanded during HTMLPurifier_HTMLDefinition->setup() processing.  
Propertypublic  $attr_transform_post= 'array()'

Indexed list of tag's HTMLPurifier_AttrTransform to be done after validation

Default valuearray()Details
Type
n/a
Propertypublic  $attr_transform_pre= 'array()'

Indexed list of tag's HTMLPurifier_AttrTransform to be done before validation

Default valuearray()Details
Type
n/a
Propertypublic  $autoclose= 'array()'

This tag is explicitly auto-closed by the following tags.

Default valuearray()Details
Type
n/a
Propertypublic  $child= ''

HTMLPurifier_ChildDef of this tag.

Details
Type
n/a
Propertypublic  $content_model= ''

Abstract string representation of internal ChildDef rules. See HTMLPurifier_ContentSets for how this is parsed and then transformed into an HTMLPurifier_ChildDef.

Details
Type
n/a
Warning
This is a temporary variable that is not available after being processed by HTMLDefinition  
Propertypublic  $content_model_type= ''

Value of $child->type, used to determine which ChildDef to use, used in combination with $content_model.

Details
Type
n/a
Warning
This must be lowercase  
Warning
This is a temporary variable that is not available after being processed by HTMLDefinition  
Propertypublic  $descendants_are_inline= 'false'

Does the element have a content model (#PCDATA | Inline)*? This is important for chameleon ins and del processing in HTMLPurifier_ChildDef_Chameleon. Dynamically set: modules don't have to worry about this one.

Default valuefalseDetails
Type
n/a
Propertypublic  $excludes= 'array()'

Lookup table of tags excluded from all descendants of this tag.

Default valuearray()Details
Type
n/a
Note
SGML permits exclusions for all descendants, but this is not possible with DTDs or XML Schemas. W3C has elected to use complicated compositions of content_models to simulate exclusion for children, but we go the simpler, SGML-style route of flat-out exclusions, which correctly apply to all descendants and not just children. Note that the XHTML Modularization Abstract Modules are blithely unaware of such distinctions.  
Propertypublic  $formatting= ''

Whether or not this is a formatting element affected by the "Active Formatting Elements" algorithm.

Details
Type
n/a
Propertypublic  $required_attr= 'array()'

List of the names of required attributes this element has. Dynamically populated by HTMLPurifier_HTMLDefinition::getElement

Default valuearray()Details
Type
n/a
Propertypublic  $standalone= 'true'

Does the definition work by itself, or is it created solely for the purpose of merging into another definition?

Default valuetrueDetails
Type
n/a
Propertypublic  $wrap= ''

If a foreign element is found in this element, test if it is allowed by this sub-element; if it is, instead of closing the current element, place it inside this element.

Details
Type
n/a

Methods

methodprivate_mergeAssocArray( \$a1 $a1, \$a2 $a2 ) : void

Merges one array into another, removes values which equal false

Parameters
Name Type Description
$a1 \$a1

Array by reference that is merged into

$a2 \$a2

Array that merges into $a1

methodpubliccreate(  $content_model,  $content_model_type,  $attr ) : void
static

Low-level factory constructor for creating new standalone element defs

Parameters
Name Type Description
$content_model
$content_model_type
$attr
methodpublicmergeIn(  $def ) : void

Merges the values of another element definition into this one.

Values from the new element def take precedence if a value is not mergeable.

Parameters
Name Type Description
$def

\HTMLPurifier_Encoder

Package: SugarCRM

A UTF-8 specific character encoder that handles cleaning and transforming.

Note
All functions in this class should be static.  

Methods

methodprivate__construct( ) : void

Constructor throws fatal error if you attempt to instantiate class

methodpubliccleanUTF8(  $str,  $force_php = false ) : void
static

Cleans a UTF-8 string for well-formedness and SGML validity

It will parse according to UTF-8 and return a valid UTF8 string, with non-SGML codepoints excluded.

Parameters
Name Type Description
$str
$force_php
Details
Note
Just for reference, the non-SGML code points are 0 to 31 and 127 to 159, inclusive. However, we allow code points 9, 10 and 13, which are the tab, line feed and carriage return respectively. 128 and above the code points map to multibyte UTF-8 representations.  
Note
Fallback code adapted from utf8ToUnicode by Henri Sivonen and hsivonen@iki.fi at under the LGPL license. Notes on what changed are inside, but in general, the original code transformed UTF-8 text into an array of integer Unicode codepoints. Understandably, transforming that back to a string would be somewhat expensive, so the function was modded to directly operate on the string. However, this discourages code reuse, and the logic enumerated here would be useful for any function that needs to be able to understand UTF-8 characters. As of right now, only smart lossless character encoding converters would need that, and I'm probably not going to implement them. Once again, PHP 6 should solve all our problems.  
methodpublicconvertFromUTF8(  $str,  $config,  $context ) : void
static

Converts a string from UTF-8 based on configuration.

Parameters
Name Type Description
$str
$config
$context
Details
Note
Currently, this is a lossy conversion, with unexpressable characters being omitted.  
methodpublicconvertToASCIIDumbLossless( \$str $str ) : void
static

Lossless (character-wise) conversion of HTML to ASCII

Parameters
Name Type Description
$str \$str

UTF-8 string to be converted to ASCII

Details
Note
Uses decimal numeric entities since they are best supported.  
Note
This is a DUMB function: it has no concept of keeping character entities that the projected character encoding can allow. We could possibly implement a smart version but that would require it to also know which Unicode codepoints the charset supported (not an easy task).  
Note
Sort of with cleanUTF8() but it assumes that $str is well-formed UTF-8  
Returns
ASCII encoded string with non-ASCII character entity-ized  
Warning
Adapted from MediaWiki, claiming fair use: this is a common algorithm. If you disagree with this license fudgery, implement it yourself.  
methodpublicconvertToUTF8(  $str,  $config,  $context ) : void
static

Converts a string to UTF-8 based on configuration.

Parameters
Name Type Description
$str
$config
$context
methodpublicmuteErrorHandler( ) : void
static

Error-handler that mutes errors, alternative to shut-up operator.

methodpublictestEncodingSupportsASCII( string $encoding, bool $bypass = false ) : Array
static

This expensive function tests whether or not a given character encoding supports ASCII. 7/8-bit encodings like Shift_JIS will fail this test, and require special processing. Variable width encodings shouldn't ever fail.

Parameters
Name Type Description
$encoding string

Encoding name to test, as per iconv format

$bypass bool

Whether or not to bypass the precompiled arrays.

Returns
Type Description
Array of UTF-8 characters to their corresponding ASCII, which can be used to "undo" any overzealous iconv action.
methodpublicunichr(  $code ) : void
static

Parameters
Name Type Description
$code

\HTMLPurifier_EntityLookup

Package: SugarCRM

Object that provides entity lookup table from entity name to character

Properties

Propertypublic  $table= ''

Assoc array of entity name to character represented.

Details
Type
n/a

Methods

methodpublicinstance( \Optional $prototype = false ) : void
static

Retrieves sole instance of the object.

Parameters
Name Type Description
$prototype \Optional

prototype of custom lookup table to overload with.

methodpublicsetup(  $file = false ) : void

Sets up the entity lookup table from the serialized file contents.

Parameters
Name Type Description
$file
Details
Note
The serialized contents are versioned, but were generated using the maintenance script generate_entity_file.php  
Warning
This is not in constructor to help enforce the Singleton  

\HTMLPurifier_EntityParser

Package: SugarCRM

Handles referencing and derefencing character entities

Properties

Propertyprotected  $_entity_lookup= ''

Reference to entity lookup table.

Details
Type
n/a
Propertyprotected  $_special_dec2str= 'array( 34 => '"', 38 => '&', 39 => "'", 60 => '<', 62 => '>' )'

Decimal to parsed string conversion table for special entities.

Default valuearray( 34 => '"', 38 => '&', 39 => "'", 60 => '<', 62 => '>' )Details
Type
n/a
Propertyprotected  $_special_ent2dec= 'array( 'quot' => 34, 'amp' => 38, 'lt' => 60, 'gt' => 62 )'

Stripped entity names to decimal conversion table for special entities.

Default valuearray( 'quot' => 34, 'amp' => 38, 'lt' => 60, 'gt' => 62 )Details
Type
n/a
Propertyprotected  $_substituteEntitiesRegex= ''/&(?:[#]x([a-fA-F0-9]+)|[#]0*(\d+)|([A-Za-z_:][A-Za-z0-9.\-_:]*));?/''

Callback regex string for parsing entities.

Default value'/&(?:[#]x([a-fA-F0-9]+)|[#]0*(\d+)|([A-Za-z_:][A-Za-z0-9.\-_:]*));?/'Details
Type
n/a

Methods

methodprotectednonSpecialEntityCallback( \$matches $matches ) : void

Callback function for substituteNonSpecialEntities() that does the work.

Parameters
Name Type Description
$matches \$matches

PCRE matches array, with 0 the entire match, and either index 1, 2 or 3 set with a hex value, dec value, or string (respectively).

Details
Returns
Replacement string.  
methodprotectedspecialEntityCallback( \$matches $matches ) : void

Callback function for substituteSpecialEntities() that does the work.

This callback has same syntax as nonSpecialEntityCallback().

Parameters
Name Type Description
$matches \$matches

PCRE-style matches array, with 0 the entire match, and either index 1, 2 or 3 set with a hex value, dec value, or string (respectively).

Details
Returns
Replacement string.  
methodpublicsubstituteNonSpecialEntities( \$string $string ) : void

Substitutes non-special entities with their parsed equivalents. Since running this whenever you have parsed character is t3h 5uck, we run it before everything else.

Parameters
Name Type Description
$string \$string

String to have non-special entities parsed.

Details
Returns
Parsed string.  
methodpublicsubstituteSpecialEntities( \$string $string ) : void

Substitutes only special entities with their parsed equivalents.

Parameters
Name Type Description
$string \$string

String to have non-special entities parsed.

Details
Notice
We try to avoid calling this function because otherwise, it would have to be called a lot (for every parsed section).  
Returns
Parsed string.  

\HTMLPurifier_ErrorCollector

Package: SugarCRM

Error collection class that enables HTML Purifier to report HTML problems back to the user

Constants

Constant  LINENO = 0

Identifiers for the returned error array. These are purposely numeric so list() can be used.

Constant  SEVERITY = 1
Constant  MESSAGE = 2
Constant  CHILDREN = 3

Properties

Propertyprotected  $_current= ''
Details
Type
n/a
Propertyprotected  $_stacks= 'array(array())'
Default valuearray(array())Details
Type
n/a
Propertyprotected  $context= ''
Details
Type
n/a
Propertyprotected  $errors= ''
Details
Type
n/a
Propertyprotected  $generator= ''
Details
Type
n/a
Propertyprotected  $lines= 'array()'
Default valuearray()Details
Type
n/a
Propertyprotected  $locale= ''
Details
Type
n/a

Methods

methodpublic__construct(  $context ) : void

Parameters
Name Type Description
$context
methodprivate_renderStruct(  $ret,  $struct,  $line = null,  $col = null ) : void

Parameters
Name Type Description
$ret
$struct
$line
$col
methodpublicgetHTMLFormatted( \$config $config, \$errors $errors = null ) : void

Default HTML formatting implementation for error messages

Parameters
Name Type Description
$config \$config

Configuration array, vital for HTML output nature

$errors \$errors

Errors array to display; used for recursion.

methodpublicgetRaw( ) : void

Retrieves raw error data for custom formatter to use

methodpublicsend( \$severity $severity, \$msg $msg ) : void

Sends an error message to the collector for later use

Parameters
Name Type Description
$severity \$severity

int Error severity, PHP error style (don't use E_USER_)

$msg \$msg

string Error message text

\HTMLPurifier_ErrorStruct

Package: SugarCRM

Records errors for particular segments of an HTML document such as tokens, attributes or CSS properties. They can contain error structs (which apply to components of what they represent), but their main purpose is to hold errors applying to whatever struct is being used.

Constants

Constant  TOKEN = 0

Possible values for $children first-key. Note that top-level structures are automatically token-level.

Constant  ATTR = 1
Constant  CSSPROP = 2

Properties

Propertypublic  $children= 'array()'

Child ErrorStructs that are from this structure. For example, a TOKEN ErrorStruct would contain ATTR ErrorStructs. This is a multi-dimensional array in structure: [TYPE]['identifier']

Default valuearray()Details
Type
n/a
Propertypublic  $errors= 'array()'

Errors registered for this structure.

Default valuearray()Details
Type
n/a
Propertypublic  $type= ''

Type of this struct.

Details
Type
n/a
Propertypublic  $value= ''

Value of the struct we are recording errors for. There are various values for this: - TOKEN: Instance of HTMLPurifier_Token - ATTR: array('attr-name', 'value') - CSSPROP: array('prop-name', 'value')

Details
Type
n/a

Methods

methodpublicaddError(  $severity,  $message ) : void

Parameters
Name Type Description
$severity
$message
methodpublicgetChild(  $type,  $id ) : void

Parameters
Name Type Description
$type
$id

\HTMLPurifier_Exception

Package: SugarCRM

Global exception class for HTML Purifier; any exceptions we throw are from here.

Parent(s)
\Exception
Children
\HTMLPurifier_VarParserException
\HTMLPurifier_ConfigSchema_Exception

\HTMLPurifier_Filter

Package: SugarCRM

Represents a pre or post processing filter on HTML Purifier's output

Sometimes, a little ad-hoc fixing of HTML has to be done before it gets sent through HTML Purifier: you can use filters to acheive this effect. For instance, YouTube videos can be preserved using this manner. You could have used a decorator for this task, but PHP's support for them is not terribly robust, so we're going to just loop through the filters.

Filters should be exited first in, last out. If there are three filters, named 1, 2 and 3, the order of execution should go 1->preFilter, 2->preFilter, 3->preFilter, purify, 3->postFilter, 2->postFilter, 1->postFilter.

Children
\HTMLPurifier_Filter_Xmp
\HTMLPurifier_Filter_ExtractStyleBlocks
\HTMLPurifier_Filter_YouTube
Note
Methods are not declared abstract as it is perfectly legitimate for an implementation not to want anything to happen on a step  

Properties

Propertypublic  $name= ''

Name of the filter for identification purposes

Details
Type
n/a

Methods

methodpublicpostFilter(  $html,  $config,  $context ) : void

Post-processor function, handles HTML after HTML Purifier

Parameters
Name Type Description
$html
$config
$context
methodpublicpreFilter(  $html,  $config,  $context ) : void

Pre-processor function, handles HTML before HTML Purifier

Parameters
Name Type Description
$html
$config
$context

\HTMLPurifier_Generator

Package: SugarCRM

Generates HTML from tokens.

Todo
Refactor interface so that configuration/context is determined upon instantiation, no need for messy generateFromTokens() calls  
Todo
Make some of the more internal functions protected, and have unit tests work around that  

Properties

Propertyprivate  $_def= ''

Cache of HTMLDefinition during HTML output to determine whether or not attributes should be minimized.

Details
Type
n/a
Propertyprivate  $_flashCompat= ''

Cache of %Output.FlashCompat

Details
Type
n/a
Propertyprivate  $_flashStack= 'array()'

Stack for keeping track of object information when outputting IE compatibility code.

Default valuearray()Details
Type
n/a
Propertyprivate  $_innerHTMLFix= ''

Cache of %Output.FixInnerHTML

Details
Type
n/a
Propertyprivate  $_scriptFix= 'false'

:HACK: Whether or not generator should comment the insides of <script> tags

Default valuefalseDetails
Type
n/a
Propertyprivate  $_sortAttr= ''

Cache of %Output.SortAttr

Details
Type
n/a
Propertyprivate  $_xhtml= 'true'

Whether or not generator should produce XML output

Default valuetrueDetails
Type
n/a
Propertyprotected  $config= ''

Configuration for the generator

Details
Type
n/a

Methods

methodpublic__construct( \$config $config, \$context $context ) : void

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

methodpublicescape( \$string $string, \$quote $quote = null ) : String

Escapes raw text data.

Parameters
Name Type Description
$string \$string

String data to escape for HTML.

$quote \$quote

Quoting style, like htmlspecialchars. ENT_NOQUOTES is permissible for non-attribute output.

Returns
Type Description
String escaped data.
Details
Todo
This really ought to be protected, but until we have a facility for properly generating HTML here w/o using tokens, it stays public.  
methodpublicgenerateAttributes( \$assoc_array_of_attributes $assoc_array_of_attributes, \$element $element = false ) : \Generate

Generates attribute declarations from attribute array.

Parameters
Name Type Description
$assoc_array_of_attributes \$assoc_array_of_attributes

Attribute array

$element \$element

Name of element attributes are for, used to check attribute minimization.

Returns
Type Description
\Generate HTML fragment for insertion.
Details
Note
This does not include the leading or trailing space.  
methodpublicgenerateFromToken( \$token $token ) : \Generated

Generates HTML from a single token.

Parameters
Name Type Description
$token \$token

HTMLPurifier_Token object.

Returns
Type Description
\Generated HTML
methodpublicgenerateFromTokens( \$tokens $tokens ) : \Generated

Generates HTML from an array of tokens.

Parameters
Name Type Description
$tokens \$tokens

Array of HTMLPurifier_Token

Returns
Type Description
\Generated HTML
methodpublicgenerateScriptFromToken(  $token ) : void

Special case processor for the contents of script tags

Parameters
Name Type Description
$token
Details
Warning
This runs into problems if there's already a literal --> somewhere inside the script contents.  

\HTMLPurifier_HTMLDefinition

Package: SugarCRM

Definition of the purified HTML that describes allowed children, attributes, and many other things.

Conventions:

All member variables that are prefixed with info (including the main $info array) are used by HTML Purifier internals and should not be directly edited when customizing the HTMLDefinition. They can usually be set via configuration directives or custom modules.

On the other hand, member variables without the info prefix are used internally by the HTMLDefinition and MUST NOT be used by other HTML Purifier internals. Many of them, however, are public, and may be edited by userspace code to tweak the behavior of HTMLDefinition.

Parent(s)
\HTMLPurifier_Definition
Note
This class is inspected by Printer_HTMLDefinition; please update that class if things here change.  
Warning
Directives that change this object's structure must be in the HTML or Attr namespace!  

Properties

Propertyprivate  $_anonModule= ''
Details
Type
n/a
Propertypublic  $doctype= ''

Doctype object

Details
Type
n/a
Propertypublic  $info= 'array()'

Associative array of element names to HTMLPurifier_ElementDef

Default valuearray()Details
Type
n/a
Propertypublic  $info_attr_transform_post= 'array()'

Indexed list of HTMLPurifier_AttrTransform to be performed after validation.

Default valuearray()Details
Type
n/a
Propertypublic  $info_attr_transform_pre= 'array()'

Indexed list of HTMLPurifier_AttrTransform to be performed before validation.

Default valuearray()Details
Type
n/a
Propertypublic  $info_block_wrapper= ''p''

String name of element used to wrap inline elements in block context

Default value'p'Details
Type
n/a
Note
This is rarely used except for BLOCKQUOTEs in strict mode  
Propertypublic  $info_content_sets= 'array()'

Nested lookup array of content set name (Block, Inline) to element name to whether or not it belongs in that content set.

Default valuearray()Details
Type
n/a
Propertypublic  $info_global_attr= 'array()'

Associative array of global attribute name to attribute definition.

Default valuearray()Details
Type
n/a
Propertypublic  $info_injector= 'array()'

Indexed list of HTMLPurifier_Injector to be used.

Default valuearray()Details
Type
n/a
Propertypublic  $info_parent= ''div''

String name of parent element HTML will be going into.

Default value'div'Details
Type
n/a
Propertypublic  $info_parent_def= ''

Definition for parent element, allows parent element to be a tag that's not allowed inside the HTML fragment.

Details
Type
n/a
Propertypublic  $info_tag_transform= 'array()'

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Default valuearray()Details
Type
n/a
Propertypublic  $manager= ''
Details
Type
n/a
Propertypublic  $optimized= 'null'
inherited

If true, write out the final definition object to the cache after setup. This will be true only if all invocations to get a raw definition object are also optimized. This does not cause file system thrashing because on subsequent calls the cached object is used and any writes to the raw definition object are short circuited. See enduser-customize.html for the high-level picture.

Inherited from: \HTMLPurifier_Definition::$$optimized
Default valuenullDetails
Type
n/a
Inherited_from
\HTMLPurifier_Definition::$$optimized  
Propertypublic  $setup= 'false'
inherited

Has setup() been called yet?

Inherited from: \HTMLPurifier_Definition::$$setup
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_Definition::$$setup  
Propertypublic  $type= ''HTML''

What type of definition is it?

Default value'HTML'Details
Type
n/a

Methods

methodpublic__construct( ) : void

Performs low-cost, preliminary initialization.

methodpublicaddAttribute( \$element_name $element_name, \$attr_name $attr_name, \$def $def ) : void

Adds a custom attribute to a pre-existing element

Parameters
Name Type Description
$element_name \$element_name

String element name to add attribute to

$attr_name \$attr_name

String name of attribute

$def \$def

Attribute definition, can be string or object, see HTMLPurifier_AttrTypes for details

Details
Note
This is strictly convenience, and does not have a corresponding method in HTMLPurifier_HTMLModule  
methodpublicaddBlankElement(  $element_name ) : void

Adds a blank element to your HTML definition, for overriding existing behavior

Parameters
Name Type Description
$element_name
Details
Note
See HTMLPurifier_HTMLModule::addBlankElement for detailed parameter and return value descriptions.  
methodpublicaddElement(  $element_name,  $type,  $contents,  $attr_collections,  $attributes = array() ) : void

Adds a custom element to your HTML definition

Parameters
Name Type Description
$element_name
$type
$contents
$attr_collections
$attributes
Details
Note
See HTMLPurifier_HTMLModule::addElement for detailed parameter and return value descriptions.  
methodprotecteddoSetup( \$config $config ) : void

Sets up the definition object into the final form, something not done by the constructor

Parameters
Name Type Description
$config \$config

HTMLPurifier_Config instance

methodpublicgetAnonymousModule( ) : void

Retrieves a reference to the anonymous module, so you can bust out advanced features without having to make your own module.

methodpublicparseTinyMCEAllowedList( \$list $list ) : void

Parses a TinyMCE-flavored Allowed Elements and Attributes list into separate lists for processing. Format is element[attr1|attr2],element2...

Parameters
Name Type Description
$list \$list

String list to parse

Details
Todo
Give this its own class, probably static interface  
Warning
Although it's largely drawn from TinyMCE's implementation, it is different, and you'll probably have to modify your lists  
methodprotectedprocessModules(  $config ) : void

Extract out the information from the manager

Parameters
Name Type Description
$config
methodpublicsetup( \$config $config ) : void
inherited

Setup function that aborts if already setup

Inherited from: \HTMLPurifier_Definition::setup()
Parameters
Name Type Description
$config \$config

HTMLPurifier_Config instance

methodprotectedsetupConfigStuff(  $config ) : void

Sets up stuff based on config. We need a better way of doing this.

Parameters
Name Type Description
$config

\HTMLPurifier_HTMLModule

Package: SugarCRM

Represents an XHTML 1.1 module, with information on elements, tags and attributes.

Children
\HTMLPurifier_HTMLModule_Bdo
\HTMLPurifier_HTMLModule_CommonAttributes
\HTMLPurifier_HTMLModule_Edit
\HTMLPurifier_HTMLModule_Forms
\HTMLPurifier_HTMLModule_Hypertext
\HTMLPurifier_HTMLModule_Image
\HTMLPurifier_HTMLModule_Legacy
\HTMLPurifier_HTMLModule_List
\HTMLPurifier_HTMLModule_Name
\HTMLPurifier_HTMLModule_Nofollow
\HTMLPurifier_HTMLModule_NonXMLCommonAttributes
\HTMLPurifier_HTMLModule_Object
\HTMLPurifier_HTMLModule_Presentation
\HTMLPurifier_HTMLModule_Proprietary
\HTMLPurifier_HTMLModule_Ruby
\HTMLPurifier_HTMLModule_SafeEmbed
\HTMLPurifier_HTMLModule_SafeObject
\HTMLPurifier_HTMLModule_Scripting
\HTMLPurifier_HTMLModule_StyleAttribute
\HTMLPurifier_HTMLModule_Tables
\HTMLPurifier_HTMLModule_Target
\HTMLPurifier_HTMLModule_Text
\HTMLPurifier_HTMLModule_Tidy
\HTMLPurifier_HTMLModule_XMLCommonAttributes
Note
Even though this is technically XHTML 1.1, it is also used for regular HTML parsing. We are using modulization as a convenient way to represent the internals of HTMLDefinition, and our implementation is by no means conforming and does not directly use the normative DTDs or XML schemas.  
Note
The public variables in a module should almost directly correspond to the variables in HTMLPurifier_HTMLDefinition. However, the prefix info carries no special meaning in these objects (include it anyway if that's the correspondence though).  
Todo
Consider making some member functions protected  

Properties

Propertypublic  $attr_collections= 'array()'

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Default valuearray()Details
Type
n/a
Propertypublic  $content_sets= 'array()'

Associative array of content set names to content set additions.

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Propertypublic  $defines_child_def= 'false'

Boolean flag that indicates whether or not getChildDef is implemented.

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Propertypublic  $elements= 'array()'

Informally, a list of elements this module changes. Not used in any significant way.

Default valuearray()Details
Type
n/a
Propertypublic  $info= 'array()'

Associative array of element names to element definitions.

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Propertypublic  $info_attr_transform_post= 'array()'

List of HTMLPurifier_AttrTransform to be performed after validation.

Default valuearray()Details
Type
n/a
Propertypublic  $info_attr_transform_pre= 'array()'

List of HTMLPurifier_AttrTransform to be performed before validation.

Default valuearray()Details
Type
n/a
Propertypublic  $info_injector= 'array()'

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Propertypublic  $info_tag_transform= 'array()'

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Default valuearray()Details
Type
n/a
Propertypublic  $name= ''

Short unique string identifier of the module

Details
Type
n/a
Propertypublic  $safe= 'true'

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Default valuetrueDetails
Type
n/a
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created

Convenience function that creates a totally blank, non-standalone element.

Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created

Convenience function that sets up a new element

Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void

Convenience function that registers an element to a content set

Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup

Convenience function that generates a lookup table with boolean true as value.

Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void

Convenience function that merges a list of attribute includes into an attribute array.

Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void

Convenience function that transforms single-string contents into separate content model and content model type

Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModuleManager

Package:

Properties

Propertypublic  $attrCollections= ''
Details
Type
n/a
Propertypublic  $attrTypes= ''

Instance of HTMLPurifier_AttrTypes

Details
Type
n/a
Propertypublic  $contentSets= ''
Details
Type
n/a
Propertypublic  $doctype= ''

Instance of current doctype

Details
Type
n/a
Propertypublic  $doctypes= ''

Instance of HTMLPurifier_DoctypeRegistry

Details
Type
n/a
Propertypublic  $elementLookup= 'array()'

Associative array of element name to list of modules that have definitions for the element; this array is dynamically filled.

Default valuearray()Details
Type
n/a
Propertypublic  $modules= 'array()'

Active instances of modules for the specified doctype are indexed, by name, in this array.

Default valuearray()Details
Type
n/a
Propertypublic  $prefixes= 'array('HTMLPurifier_HTMLModule_')'

List of prefixes we should use for registering small names

Default valuearray('HTMLPurifier_HTMLModule_')Details
Type
n/a
Propertypublic  $registeredModules= 'array()'

Array of recognized HTMLPurifier_Module instances, indexed by module's class name. This array is usually lazy loaded, but a user can overload a module by pre-emptively registering it.

Default valuearray()Details
Type
n/a
Propertypublic  $trusted= 'false'

If set to true, unsafe elements and attributes will be allowed

Default valuefalseDetails
Type
n/a
Propertypublic  $userModules= 'array()'

List of extra modules that were added by the user using addModule().

These get unconditionally merged into the current doctype, whatever it may be.

Default valuearray()Details
Type
n/a

Methods

methodpublic__construct( ) : void

methodpublicaddModule(  $module ) : void

Adds a module to the current doctype by first registering it, and then tacking it on to the active doctype

Parameters
Name Type Description
$module
methodpublicaddPrefix(  $prefix ) : void

Adds a class prefix that registerModule() will use to resolve a string name to a concrete class

Parameters
Name Type Description
$prefix
methodpublicgetElement( \$name $name, \$trusted $trusted = null ) : \Merged

Retrieves a single merged element definition

Parameters
Name Type Description
$name \$name

Name of element

$trusted \$trusted

Boolean trusted overriding parameter: set to true if you want the full version of an element

Returns
Type Description
\Merged HTMLPurifier_ElementDef
Details
Note
You may notice that modules are getting iterated over twice (once in getElements() and once here). This is because  
methodpublicgetElements( ) : Array

Retrieves merged element definitions.

Returns
Type Description
Array of HTMLPurifier_ElementDef
methodpublicprocessModule(  $module ) : void

Takes a module and adds it to the active module collection, registering it if necessary.

Parameters
Name Type Description
$module
methodpublicregisterModule( \$module $module, \$overload $overload = false ) : void

Registers a module to the recognized module list, useful for overloading pre-existing modules.

Parameters
Name Type Description
$module \$module

Mixed: string module name, with or without HTMLPurifier_HTMLModule prefix, or instance of subclass of HTMLPurifier_HTMLModule.

$overload \$overload

Boolean whether or not to overload previous modules. If this is not set, and you do overload a module, HTML Purifier will complain with a warning.

Details
Note
This function will not call autoload, you must instantiate (and thus invoke) autoload outside the method.  
Note
If a string is passed as a module name, different variants will be tested in this order: - Check for HTMLPurifier_HTMLModule_$name - Check all prefixes with $name in order they were added - Check for literal object name - Throw fatal error If your object name collides with an internal class, specify your module manually. All modules must have been included externally: registerModule will not perform inclusions for you!  
methodpublicsetup( \$config $config ) : void

Performs processing on modules, after being called you may use getElement() and getElements()

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Bdo

Package: SugarCRM

XHTML 1.1 Bi-directional Text Module, defines elements that declare directionality of content. Text Extension Module.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array( 'I18N' => array('dir' => false) )'

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Default valuearray( 'I18N' => array('dir' => false) )Details
Type
n/a
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Bdo''

Short unique string identifier of the module

Default value'Bdo'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_CommonAttributes

Package:

Represents an XHTML 1.1 module, with information on elements, tags and attributes.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array( 'Core' => array( 0 => array('Style'), // 'xml:space' => false, 'class' => 'Class', 'id' => 'ID', 'title' => 'CDATA', ), 'Lang' => array(), 'I18N' => array( 0 => array('Lang'), // proprietary, for xml:lang/lang ), 'Common' => array( 0 => array('Core', 'I18N') ) )'

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Default valuearray( 'Core' => array( 0 => array('Style'), // 'xml:space' => false, 'class' => 'Class', 'id' => 'ID', 'title' => 'CDATA', ), 'Lang' => array(), 'I18N' => array( 0 => array('Lang'), // proprietary, for xml:lang/lang ), 'Common' => array( 0 => array('Core', 'I18N') ) )Details
Type
n/a
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''CommonAttributes''

Short unique string identifier of the module

Default value'CommonAttributes'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void
inherited

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Inherited from: \HTMLPurifier_HTMLModule::setup()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Edit

Package: SugarCRM

XHTML 1.1 Edit Module, defines editing-related elements. Text Extension Module.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'true'

Boolean flag that indicates whether or not getChildDef is implemented.

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuetrueDetails
Type
n/a
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Edit''

Short unique string identifier of the module

Default value'Edit'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Forms

Package: SugarCRM

XHTML 1.1 Forms module, defines all form-related elements found in HTML 4.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array( 'Block' => 'Form', 'Inline' => 'Formctrl', )'

Associative array of content set names to content set additions.

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray( 'Block' => 'Form', 'Inline' => 'Formctrl', )Details
Type
n/a
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Forms''

Short unique string identifier of the module

Default value'Forms'Details
Type
n/a
Propertypublic  $safe= 'false'

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Default valuefalseDetails
Type
n/a

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Hypertext

Package: SugarCRM

XHTML 1.1 Hypertext Module, defines hypertext links. Core Module.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Hypertext''

Short unique string identifier of the module

Default value'Hypertext'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Image

Package: SugarCRM

XHTML 1.1 Image Module provides basic image embedding.

Parent(s)
\HTMLPurifier_HTMLModule
Note
There is specialized code for removing empty images in HTMLPurifier_Strategy_RemoveForeignElements  

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Image''

Short unique string identifier of the module

Default value'Image'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Legacy

Package: SugarCRM

XHTML 1.1 Legacy module defines elements that were previously deprecated.

Parent(s)
\HTMLPurifier_HTMLModule
Note
Not all legacy elements have been implemented yet, which is a bit of a reverse problem as compared to browsers! In addition, this legacy module may implement a bit more than mandated by XHTML 1.1. This module can be used in combination with TransformToStrict in order to transform as many deprecated elements as possible, but retain questionably deprecated elements that do not have good alternatives as well as transform elements that don't have an implementation. See docs/ref-strictness.txt for more details.  

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Legacy''

Short unique string identifier of the module

Default value'Legacy'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_List

Package: SugarCRM

XHTML 1.1 List Module, defines list-oriented elements. Core Module.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array('Flow' => 'List')'

Associative array of content set names to content set additions.

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray('Flow' => 'List')Details
Type
n/a
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''List''

Short unique string identifier of the module

Default value'List'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Name

Package:

Represents an XHTML 1.1 module, with information on elements, tags and attributes.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Name''

Short unique string identifier of the module

Default value'Name'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Nofollow

Package: SugarCRM

Module adds the nofollow attribute transformation to a tags. It is enabled by HTML.Nofollow

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Nofollow''

Short unique string identifier of the module

Default value'Nofollow'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_NonXMLCommonAttributes

Package:

Represents an XHTML 1.1 module, with information on elements, tags and attributes.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array( 'Lang' => array( 'lang' => 'LanguageCode', ) )'

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Default valuearray( 'Lang' => array( 'lang' => 'LanguageCode', ) )Details
Type
n/a
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''NonXMLCommonAttributes''

Short unique string identifier of the module

Default value'NonXMLCommonAttributes'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void
inherited

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Inherited from: \HTMLPurifier_HTMLModule::setup()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Object

Package: SugarCRM

XHTML 1.1 Object Module, defines elements for generic object inclusion

Parent(s)
\HTMLPurifier_HTMLModule
Warning
Users will commonly use to cater to legacy browsers: this module does not allow this sort of behavior  

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Object''

Short unique string identifier of the module

Default value'Object'Details
Type
n/a
Propertypublic  $safe= 'false'

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Default valuefalseDetails
Type
n/a

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Presentation

Package: SugarCRM

XHTML 1.1 Presentation Module, defines simple presentation-related markup. Text Extension Module.

Parent(s)
\HTMLPurifier_HTMLModule
Note
The official XML Schema and DTD specs further divide this into two modules: - Block Presentation (hr) - Inline Presentation (b, big, i, small, sub, sup, tt) We have chosen not to heed this distinction, as content_sets provides satisfactory disambiguation.  

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Presentation''

Short unique string identifier of the module

Default value'Presentation'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Proprietary

Package: SugarCRM

Module defines proprietary tags and attributes in HTML.

Parent(s)
\HTMLPurifier_HTMLModule
Warning
If this module is enabled, standards-compliance is off!  

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Proprietary''

Short unique string identifier of the module

Default value'Proprietary'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Ruby

Package: SugarCRM

XHTML 1.1 Ruby Annotation Module, defines elements that indicate short runs of text alongside base text for annotation or pronounciation.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Ruby''

Short unique string identifier of the module

Default value'Ruby'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_SafeEmbed

Package: SugarCRM

A "safe" embed module. See SafeObject. This is a proprietary element.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''SafeEmbed''

Short unique string identifier of the module

Default value'SafeEmbed'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_SafeObject

Package: SugarCRM

A "safe" object module. In theory, objects permitted by this module will be safe, and untrusted users can be allowed to embed arbitrary flash objects (maybe other types too, but only Flash is supported as of right now).

Highly experimental.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''SafeObject''

Short unique string identifier of the module

Default value'SafeObject'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Scripting

Package: SugarCRM

XHTML 1.1 Scripting module, defines elements that are used to contain information pertaining to executable scripts or the lack of support for executable scripts.

Parent(s)
\HTMLPurifier_HTMLModule
Note
This module does not contain inline scripting elements  

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array('Block' => 'script | noscript', 'Inline' => 'script | noscript')'

Associative array of content set names to content set additions.

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray('Block' => 'script | noscript', 'Inline' => 'script | noscript')Details
Type
n/a
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array('script', 'noscript')'

Informally, a list of elements this module changes. Not used in any significant way.

Default valuearray('script', 'noscript')Details
Type
n/a
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Scripting''

Short unique string identifier of the module

Default value'Scripting'Details
Type
n/a
Propertypublic  $safe= 'false'

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Default valuefalseDetails
Type
n/a

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_StyleAttribute

Package: SugarCRM

XHTML 1.1 Edit Module, defines editing-related elements. Text Extension Module.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array( // The inclusion routine differs from the Abstract Modules but // is in line with the DTD and XML Schemas. 'Style' => array('style' => false), // see constructor 'Core' => array(0 => array('Style')) )'

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Default valuearray( // The inclusion routine differs from the Abstract Modules but // is in line with the DTD and XML Schemas. 'Style' => array('style' => false), // see constructor 'Core' => array(0 => array('Style')) )Details
Type
n/a
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''StyleAttribute''

Short unique string identifier of the module

Default value'StyleAttribute'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Tables

Package: SugarCRM

XHTML 1.1 Tables Module, fully defines accessible table elements.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Tables''

Short unique string identifier of the module

Default value'Tables'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Target

Package: SugarCRM

XHTML 1.1 Target Module, defines target attribute in link elements.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Target''

Short unique string identifier of the module

Default value'Target'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Text

Package: SugarCRM

XHTML 1.1 Text Module, defines basic text containers. Core Module.

Parent(s)
\HTMLPurifier_HTMLModule
Note
In the normative XML Schema specification, this module is further abstracted into the following modules: - Block Phrasal (address, blockquote, pre, h1, h2, h3, h4, h5, h6) - Block Structural (div, p) - Inline Phrasal (abbr, acronym, cite, code, dfn, em, kbd, q, samp, strong, var) - Inline Structural (br, span) This module, functionally, does not distinguish between these sub-modules, but the code is internally structured to reflect these distinctions.  

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array( 'Flow' => 'Heading | Block | Inline' )'

Associative array of content set names to content set additions.

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray( 'Flow' => 'Heading | Block | Inline' )Details
Type
n/a
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''Text''

Short unique string identifier of the module

Default value'Text'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Tidy

Package: SugarCRM

Abstract class for a set of proprietary modules that clean up (tidy) poorly written HTML.

Parent(s)
\HTMLPurifier_HTMLModule
Children
\HTMLPurifier_HTMLModule_Tidy_Name
\HTMLPurifier_HTMLModule_Tidy_Proprietary
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4
\HTMLPurifier_HTMLModule_Tidy_XHTML
Todo
Figure out how to protect some of these methods/properties  

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defaultLevel= 'null'

Default level to place all fixes in. Disabled by default

Default valuenullDetails
Type
n/a
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $fixesForLevel= 'array( 'light' => array(), 'medium' => array(), 'heavy' => array() )'

Lists of fixes used by getFixesForLevel(). Format is: HTMLModule_Tidy->fixesForLevel[$level] = array('fix-1', 'fix-2');

Default valuearray( 'light' => array(), 'medium' => array(), 'heavy' => array() )Details
Type
n/a
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $levels= 'array(0 => 'none', 'light', 'medium', 'heavy')'

List of supported levels. Index zero is a special case "no fixes" level.

Default valuearray(0 => 'none', 'light', 'medium', 'heavy')Details
Type
n/a
Propertypublic  $name= ''
inherited

Short unique string identifier of the module

Inherited from: \HTMLPurifier_HTMLModule::$$name
Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$name  
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicgetFixType( \$name $name ) : \array(string

Parses a fix name and determines what kind of fix it is, as well as other information defined by the fix

Parameters
Name Type Description
$name \$name

String name of fix

Returns
Type Description
\array(string $fix_type, array $fix_parameters)
Details
Note
$fix_parameters is type dependant, see populate() for usage of these parameters  
methodpublicgetFixesForLevel( \$level $level ) : \Lookup

Retrieves all fixes per a level, returning fixes for that specific level as well as all levels below it.

Parameters
Name Type Description
$level \$level

String level identifier, see $levels for valid values

Returns
Type Description
\Lookup up table of fixes
methodpublicmakeFixes( ) : void

Defines all fixes the module will perform in a compact associative array of fix name to fix implementation.

methodpublicmakeFixesForLevel(  $fixes ) : void

Dynamically populates the $fixesForLevel member variable using the fixes array. It may be custom overloaded, used in conjunction with $defaultLevel, or not used at all.

Parameters
Name Type Description
$fixes
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicpopulate( \$lookup $fixes ) : void

Populates the module with transforms and other special-case code based on a list of fixes passed to it

Parameters
Name Type Description
$fixes \$lookup

Lookup table of fixes to activate

methodpublicsetup( \$config $config ) : void

Lazy load constructs the module by determining the necessary fixes to create and then delegating to the populate() function.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

Details
Todo
Wildcard matching and error reporting when an added or subtracted fix has no effect.  

\HTMLPurifier_HTMLModule_Tidy_Name

Package: SugarCRM

Name is deprecated, but allowed in strict doctypes, so onl

Parent(s)
\HTMLPurifier_HTMLModule_Tidy < \HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections\HTMLPurifier_HTMLModule_Tidy::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets\HTMLPurifier_HTMLModule_Tidy::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$content_sets  
Propertypublic  $defaultLevel= ''heavy''

Default level to place all fixes in. Disabled by default

Default value'heavy'Details
Type
n/a
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def\HTMLPurifier_HTMLModule_Tidy::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements\HTMLPurifier_HTMLModule_Tidy::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$elements  
Propertypublic  $fixesForLevel= 'array( 'light' => array(), 'medium' => array(), 'heavy' => array() )'
inherited

Lists of fixes used by getFixesForLevel(). Format is: HTMLModule_Tidy->fixesForLevel[$level] = array('fix-1', 'fix-2');

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel
Default valuearray( 'light' => array(), 'medium' => array(), 'heavy' => array() )Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info\HTMLPurifier_HTMLModule_Tidy::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector\HTMLPurifier_HTMLModule_Tidy::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform\HTMLPurifier_HTMLModule_Tidy::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_tag_transform  
Propertypublic  $levels= 'array(0 => 'none', 'light', 'medium', 'heavy')'
inherited

List of supported levels. Index zero is a special case "no fixes" level.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$levels
Default valuearray(0 => 'none', 'light', 'medium', 'heavy')Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$levels  
Propertypublic  $name= ''Tidy_Name''

Short unique string identifier of the module

Default value'Tidy_Name'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe\HTMLPurifier_HTMLModule_Tidy::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()\HTMLPurifier_HTMLModule_Tidy::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()\HTMLPurifier_HTMLModule_Tidy::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()\HTMLPurifier_HTMLModule_Tidy::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()\HTMLPurifier_HTMLModule_Tidy::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicgetFixType( \$name $name ) : \array(string
inherited

Parses a fix name and determines what kind of fix it is, as well as other information defined by the fix

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixType()
Parameters
Name Type Description
$name \$name

String name of fix

Returns
Type Description
\array(string $fix_type, array $fix_parameters)
Details
Note
$fix_parameters is type dependant, see populate() for usage of these parameters  
methodpublicgetFixesForLevel( \$level $level ) : \Lookup
inherited

Retrieves all fixes per a level, returning fixes for that specific level as well as all levels below it.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixesForLevel()
Parameters
Name Type Description
$level \$level

String level identifier, see $levels for valid values

Returns
Type Description
\Lookup up table of fixes
methodpublicmakeFixes( ) : void

Defines all fixes the module will perform in a compact associative array of fix name to fix implementation.

methodpublicmakeFixesForLevel(  $fixes ) : void
inherited

Dynamically populates the $fixesForLevel member variable using the fixes array. It may be custom overloaded, used in conjunction with $defaultLevel, or not used at all.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::makeFixesForLevel()
Parameters
Name Type Description
$fixes
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()\HTMLPurifier_HTMLModule_Tidy::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()\HTMLPurifier_HTMLModule_Tidy::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()\HTMLPurifier_HTMLModule_Tidy::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicpopulate( \$lookup $fixes ) : void
inherited

Populates the module with transforms and other special-case code based on a list of fixes passed to it

Inherited from: \HTMLPurifier_HTMLModule_Tidy::populate()
Parameters
Name Type Description
$fixes \$lookup

Lookup table of fixes to activate

methodpublicsetup( \$config $config ) : void
inherited

Lazy load constructs the module by determining the necessary fixes to create and then delegating to the populate() function.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::setup()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Tidy_Proprietary

Package:

Abstract class for a set of proprietary modules that clean up (tidy) poorly written HTML.

Parent(s)
\HTMLPurifier_HTMLModule_Tidy < \HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections\HTMLPurifier_HTMLModule_Tidy::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets\HTMLPurifier_HTMLModule_Tidy::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$content_sets  
Propertypublic  $defaultLevel= ''light''

Default level to place all fixes in. Disabled by default

Default value'light'Details
Type
n/a
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def\HTMLPurifier_HTMLModule_Tidy::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements\HTMLPurifier_HTMLModule_Tidy::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$elements  
Propertypublic  $fixesForLevel= 'array( 'light' => array(), 'medium' => array(), 'heavy' => array() )'
inherited

Lists of fixes used by getFixesForLevel(). Format is: HTMLModule_Tidy->fixesForLevel[$level] = array('fix-1', 'fix-2');

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel
Default valuearray( 'light' => array(), 'medium' => array(), 'heavy' => array() )Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info\HTMLPurifier_HTMLModule_Tidy::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector\HTMLPurifier_HTMLModule_Tidy::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform\HTMLPurifier_HTMLModule_Tidy::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_tag_transform  
Propertypublic  $levels= 'array(0 => 'none', 'light', 'medium', 'heavy')'
inherited

List of supported levels. Index zero is a special case "no fixes" level.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$levels
Default valuearray(0 => 'none', 'light', 'medium', 'heavy')Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$levels  
Propertypublic  $name= ''Tidy_Proprietary''

Short unique string identifier of the module

Default value'Tidy_Proprietary'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe\HTMLPurifier_HTMLModule_Tidy::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()\HTMLPurifier_HTMLModule_Tidy::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()\HTMLPurifier_HTMLModule_Tidy::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()\HTMLPurifier_HTMLModule_Tidy::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()\HTMLPurifier_HTMLModule_Tidy::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicgetFixType( \$name $name ) : \array(string
inherited

Parses a fix name and determines what kind of fix it is, as well as other information defined by the fix

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixType()
Parameters
Name Type Description
$name \$name

String name of fix

Returns
Type Description
\array(string $fix_type, array $fix_parameters)
Details
Note
$fix_parameters is type dependant, see populate() for usage of these parameters  
methodpublicgetFixesForLevel( \$level $level ) : \Lookup
inherited

Retrieves all fixes per a level, returning fixes for that specific level as well as all levels below it.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixesForLevel()
Parameters
Name Type Description
$level \$level

String level identifier, see $levels for valid values

Returns
Type Description
\Lookup up table of fixes
methodpublicmakeFixes( ) : void

Defines all fixes the module will perform in a compact associative array of fix name to fix implementation.

methodpublicmakeFixesForLevel(  $fixes ) : void
inherited

Dynamically populates the $fixesForLevel member variable using the fixes array. It may be custom overloaded, used in conjunction with $defaultLevel, or not used at all.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::makeFixesForLevel()
Parameters
Name Type Description
$fixes
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()\HTMLPurifier_HTMLModule_Tidy::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()\HTMLPurifier_HTMLModule_Tidy::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()\HTMLPurifier_HTMLModule_Tidy::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicpopulate( \$lookup $fixes ) : void
inherited

Populates the module with transforms and other special-case code based on a list of fixes passed to it

Inherited from: \HTMLPurifier_HTMLModule_Tidy::populate()
Parameters
Name Type Description
$fixes \$lookup

Lookup table of fixes to activate

methodpublicsetup( \$config $config ) : void
inherited

Lazy load constructs the module by determining the necessary fixes to create and then delegating to the populate() function.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::setup()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Tidy_Strict

Package:

Abstract class for a set of proprietary modules that clean up (tidy) poorly written HTML.

Parent(s)
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 < \HTMLPurifier_HTMLModule_Tidy < \HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections\HTMLPurifier_HTMLModule_Tidy::$$attr_collections\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$attr_collections
Propertypublic  $content_sets= 'array()'

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$content_sets  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$content_sets  
Propertypublic  $defaultLevel= ''light''

Default level to place all fixes in. Disabled by default

Default value'light'Details
Type
n/a
Propertypublic  $defines_child_def= 'true'

Boolean flag that indicates whether or not getChildDef is implemented.

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuetrueDetails
Type
n/a
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements\HTMLPurifier_HTMLModule_Tidy::$$elements\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$elements  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$elements  
Propertypublic  $fixesForLevel= 'array( 'light' => array(), 'medium' => array(), 'heavy' => array() )'
inherited

Lists of fixes used by getFixesForLevel(). Format is: HTMLModule_Tidy->fixesForLevel[$level] = array('fix-1', 'fix-2');

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$fixesForLevel
Default valuearray( 'light' => array(), 'medium' => array(), 'heavy' => array() )Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$fixesForLevel  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info\HTMLPurifier_HTMLModule_Tidy::$$info\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$info  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector\HTMLPurifier_HTMLModule_Tidy::$$info_injector\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_injector  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
Propertypublic  $levels= 'array(0 => 'none', 'light', 'medium', 'heavy')'
inherited

List of supported levels. Index zero is a special case "no fixes" level.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$levels\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$levels
Default valuearray(0 => 'none', 'light', 'medium', 'heavy')Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$levels  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$levels  
Propertypublic  $name= ''Tidy_Strict''

Short unique string identifier of the module

Default value'Tidy_Strict'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe\HTMLPurifier_HTMLModule_Tidy::$$safe\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$safe  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()\HTMLPurifier_HTMLModule_Tidy::addBlankElement()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicgetFixType( \$name $name ) : \array(string
inherited

Parses a fix name and determines what kind of fix it is, as well as other information defined by the fix

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixType()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::getFixType()
Parameters
Name Type Description
$name \$name

String name of fix

Returns
Type Description
\array(string $fix_type, array $fix_parameters)
Details
Note
$fix_parameters is type dependant, see populate() for usage of these parameters  
methodpublicgetFixesForLevel( \$level $level ) : \Lookup
inherited

Retrieves all fixes per a level, returning fixes for that specific level as well as all levels below it.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixesForLevel()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::getFixesForLevel()
Parameters
Name Type Description
$level \$level

String level identifier, see $levels for valid values

Returns
Type Description
\Lookup up table of fixes
methodpublicmakeFixes( ) : void

Defines all fixes the module will perform in a compact associative array of fix name to fix implementation.

methodpublicmakeFixesForLevel(  $fixes ) : void
inherited

Dynamically populates the $fixesForLevel member variable using the fixes array. It may be custom overloaded, used in conjunction with $defaultLevel, or not used at all.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::makeFixesForLevel()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::makeFixesForLevel()
Parameters
Name Type Description
$fixes
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()\HTMLPurifier_HTMLModule_Tidy::makeLookup()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()\HTMLPurifier_HTMLModule_Tidy::mergeInAttrIncludes()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()\HTMLPurifier_HTMLModule_Tidy::parseContents()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicpopulate( \$lookup $fixes ) : void
inherited

Populates the module with transforms and other special-case code based on a list of fixes passed to it

Inherited from: \HTMLPurifier_HTMLModule_Tidy::populate()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::populate()
Parameters
Name Type Description
$fixes \$lookup

Lookup table of fixes to activate

methodpublicsetup( \$config $config ) : void
inherited

Lazy load constructs the module by determining the necessary fixes to create and then delegating to the populate() function.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::setup()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::setup()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Tidy_Transitional

Package:

Abstract class for a set of proprietary modules that clean up (tidy) poorly written HTML.

Parent(s)
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4 < \HTMLPurifier_HTMLModule_Tidy < \HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections\HTMLPurifier_HTMLModule_Tidy::$$attr_collections\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$attr_collections
Propertypublic  $content_sets= 'array()'

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$content_sets  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$content_sets  
Propertypublic  $defaultLevel= ''heavy''

Default level to place all fixes in. Disabled by default

Default value'heavy'Details
Type
n/a
Propertypublic  $defines_child_def= 'false'

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$defines_child_def  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements\HTMLPurifier_HTMLModule_Tidy::$$elements\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$elements  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$elements  
Propertypublic  $fixesForLevel= 'array( 'light' => array(), 'medium' => array(), 'heavy' => array() )'
inherited

Lists of fixes used by getFixesForLevel(). Format is: HTMLModule_Tidy->fixesForLevel[$level] = array('fix-1', 'fix-2');

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$fixesForLevel
Default valuearray( 'light' => array(), 'medium' => array(), 'heavy' => array() )Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$fixesForLevel  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info\HTMLPurifier_HTMLModule_Tidy::$$info\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$info  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector\HTMLPurifier_HTMLModule_Tidy::$$info_injector\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_injector  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
Propertypublic  $levels= 'array(0 => 'none', 'light', 'medium', 'heavy')'
inherited

List of supported levels. Index zero is a special case "no fixes" level.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$levels\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$levels
Default valuearray(0 => 'none', 'light', 'medium', 'heavy')Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$levels  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$levels  
Propertypublic  $name= ''Tidy_Transitional''

Short unique string identifier of the module

Default value'Tidy_Transitional'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe\HTMLPurifier_HTMLModule_Tidy::$$safe\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$safe  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()\HTMLPurifier_HTMLModule_Tidy::addBlankElement()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()\HTMLPurifier_HTMLModule_Tidy::getChildDef()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicgetFixType( \$name $name ) : \array(string
inherited

Parses a fix name and determines what kind of fix it is, as well as other information defined by the fix

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixType()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::getFixType()
Parameters
Name Type Description
$name \$name

String name of fix

Returns
Type Description
\array(string $fix_type, array $fix_parameters)
Details
Note
$fix_parameters is type dependant, see populate() for usage of these parameters  
methodpublicgetFixesForLevel( \$level $level ) : \Lookup
inherited

Retrieves all fixes per a level, returning fixes for that specific level as well as all levels below it.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixesForLevel()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::getFixesForLevel()
Parameters
Name Type Description
$level \$level

String level identifier, see $levels for valid values

Returns
Type Description
\Lookup up table of fixes
methodpublicmakeFixes( ) : void
inherited

Defines all fixes the module will perform in a compact associative array of fix name to fix implementation.

Inherited from: \HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::makeFixes()
methodpublicmakeFixesForLevel(  $fixes ) : void
inherited

Dynamically populates the $fixesForLevel member variable using the fixes array. It may be custom overloaded, used in conjunction with $defaultLevel, or not used at all.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::makeFixesForLevel()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::makeFixesForLevel()
Parameters
Name Type Description
$fixes
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()\HTMLPurifier_HTMLModule_Tidy::makeLookup()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()\HTMLPurifier_HTMLModule_Tidy::mergeInAttrIncludes()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()\HTMLPurifier_HTMLModule_Tidy::parseContents()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicpopulate( \$lookup $fixes ) : void
inherited

Populates the module with transforms and other special-case code based on a list of fixes passed to it

Inherited from: \HTMLPurifier_HTMLModule_Tidy::populate()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::populate()
Parameters
Name Type Description
$fixes \$lookup

Lookup table of fixes to activate

methodpublicsetup( \$config $config ) : void
inherited

Lazy load constructs the module by determining the necessary fixes to create and then delegating to the populate() function.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::setup()\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4::setup()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Tidy_XHTML

Package:

Abstract class for a set of proprietary modules that clean up (tidy) poorly written HTML.

Parent(s)
\HTMLPurifier_HTMLModule_Tidy < \HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections\HTMLPurifier_HTMLModule_Tidy::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets\HTMLPurifier_HTMLModule_Tidy::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$content_sets  
Propertypublic  $defaultLevel= ''medium''

Default level to place all fixes in. Disabled by default

Default value'medium'Details
Type
n/a
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def\HTMLPurifier_HTMLModule_Tidy::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements\HTMLPurifier_HTMLModule_Tidy::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$elements  
Propertypublic  $fixesForLevel= 'array( 'light' => array(), 'medium' => array(), 'heavy' => array() )'
inherited

Lists of fixes used by getFixesForLevel(). Format is: HTMLModule_Tidy->fixesForLevel[$level] = array('fix-1', 'fix-2');

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel
Default valuearray( 'light' => array(), 'medium' => array(), 'heavy' => array() )Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info\HTMLPurifier_HTMLModule_Tidy::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector\HTMLPurifier_HTMLModule_Tidy::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform\HTMLPurifier_HTMLModule_Tidy::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_tag_transform  
Propertypublic  $levels= 'array(0 => 'none', 'light', 'medium', 'heavy')'
inherited

List of supported levels. Index zero is a special case "no fixes" level.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$levels
Default valuearray(0 => 'none', 'light', 'medium', 'heavy')Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$levels  
Propertypublic  $name= ''Tidy_XHTML''

Short unique string identifier of the module

Default value'Tidy_XHTML'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe\HTMLPurifier_HTMLModule_Tidy::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()\HTMLPurifier_HTMLModule_Tidy::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()\HTMLPurifier_HTMLModule_Tidy::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()\HTMLPurifier_HTMLModule_Tidy::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()\HTMLPurifier_HTMLModule_Tidy::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicgetFixType( \$name $name ) : \array(string
inherited

Parses a fix name and determines what kind of fix it is, as well as other information defined by the fix

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixType()
Parameters
Name Type Description
$name \$name

String name of fix

Returns
Type Description
\array(string $fix_type, array $fix_parameters)
Details
Note
$fix_parameters is type dependant, see populate() for usage of these parameters  
methodpublicgetFixesForLevel( \$level $level ) : \Lookup
inherited

Retrieves all fixes per a level, returning fixes for that specific level as well as all levels below it.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixesForLevel()
Parameters
Name Type Description
$level \$level

String level identifier, see $levels for valid values

Returns
Type Description
\Lookup up table of fixes
methodpublicmakeFixes( ) : void

Defines all fixes the module will perform in a compact associative array of fix name to fix implementation.

methodpublicmakeFixesForLevel(  $fixes ) : void
inherited

Dynamically populates the $fixesForLevel member variable using the fixes array. It may be custom overloaded, used in conjunction with $defaultLevel, or not used at all.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::makeFixesForLevel()
Parameters
Name Type Description
$fixes
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()\HTMLPurifier_HTMLModule_Tidy::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()\HTMLPurifier_HTMLModule_Tidy::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()\HTMLPurifier_HTMLModule_Tidy::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicpopulate( \$lookup $fixes ) : void
inherited

Populates the module with transforms and other special-case code based on a list of fixes passed to it

Inherited from: \HTMLPurifier_HTMLModule_Tidy::populate()
Parameters
Name Type Description
$fixes \$lookup

Lookup table of fixes to activate

methodpublicsetup( \$config $config ) : void
inherited

Lazy load constructs the module by determining the necessary fixes to create and then delegating to the populate() function.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::setup()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_Tidy_XHTMLAndHTML4

Package:

Abstract class for a set of proprietary modules that clean up (tidy) poorly written HTML.

Parent(s)
\HTMLPurifier_HTMLModule_Tidy < \HTMLPurifier_HTMLModule
Children
\HTMLPurifier_HTMLModule_Tidy_Strict
\HTMLPurifier_HTMLModule_Tidy_Transitional

Properties

Propertypublic  $attr_collections= 'array()'
inherited

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Inherited from: \HTMLPurifier_HTMLModule::$$attr_collections\HTMLPurifier_HTMLModule_Tidy::$$attr_collections
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$attr_collections  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$attr_collections  
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets\HTMLPurifier_HTMLModule_Tidy::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$content_sets  
Propertypublic  $defaultLevel= 'null'
inherited

Default level to place all fixes in. Disabled by default

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$defaultLevel
Default valuenullDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$defaultLevel  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def\HTMLPurifier_HTMLModule_Tidy::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements\HTMLPurifier_HTMLModule_Tidy::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$elements  
Propertypublic  $fixesForLevel= 'array( 'light' => array(), 'medium' => array(), 'heavy' => array() )'
inherited

Lists of fixes used by getFixesForLevel(). Format is: HTMLModule_Tidy->fixesForLevel[$level] = array('fix-1', 'fix-2');

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel
Default valuearray( 'light' => array(), 'medium' => array(), 'heavy' => array() )Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$fixesForLevel  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info\HTMLPurifier_HTMLModule_Tidy::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector\HTMLPurifier_HTMLModule_Tidy::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform\HTMLPurifier_HTMLModule_Tidy::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$info_tag_transform  
Propertypublic  $levels= 'array(0 => 'none', 'light', 'medium', 'heavy')'
inherited

List of supported levels. Index zero is a special case "no fixes" level.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::$$levels
Default valuearray(0 => 'none', 'light', 'medium', 'heavy')Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$levels  
Propertypublic  $name= ''
inherited

Short unique string identifier of the module

Inherited from: \HTMLPurifier_HTMLModule::$$name\HTMLPurifier_HTMLModule_Tidy::$$name
Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$name  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$name  
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe\HTMLPurifier_HTMLModule_Tidy::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Inherited_from
\HTMLPurifier_HTMLModule_Tidy::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()\HTMLPurifier_HTMLModule_Tidy::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()\HTMLPurifier_HTMLModule_Tidy::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()\HTMLPurifier_HTMLModule_Tidy::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()\HTMLPurifier_HTMLModule_Tidy::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicgetFixType( \$name $name ) : \array(string
inherited

Parses a fix name and determines what kind of fix it is, as well as other information defined by the fix

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixType()
Parameters
Name Type Description
$name \$name

String name of fix

Returns
Type Description
\array(string $fix_type, array $fix_parameters)
Details
Note
$fix_parameters is type dependant, see populate() for usage of these parameters  
methodpublicgetFixesForLevel( \$level $level ) : \Lookup
inherited

Retrieves all fixes per a level, returning fixes for that specific level as well as all levels below it.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::getFixesForLevel()
Parameters
Name Type Description
$level \$level

String level identifier, see $levels for valid values

Returns
Type Description
\Lookup up table of fixes
methodpublicmakeFixes( ) : void

Defines all fixes the module will perform in a compact associative array of fix name to fix implementation.

methodpublicmakeFixesForLevel(  $fixes ) : void
inherited

Dynamically populates the $fixesForLevel member variable using the fixes array. It may be custom overloaded, used in conjunction with $defaultLevel, or not used at all.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::makeFixesForLevel()
Parameters
Name Type Description
$fixes
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()\HTMLPurifier_HTMLModule_Tidy::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()\HTMLPurifier_HTMLModule_Tidy::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()\HTMLPurifier_HTMLModule_Tidy::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicpopulate( \$lookup $fixes ) : void
inherited

Populates the module with transforms and other special-case code based on a list of fixes passed to it

Inherited from: \HTMLPurifier_HTMLModule_Tidy::populate()
Parameters
Name Type Description
$fixes \$lookup

Lookup table of fixes to activate

methodpublicsetup( \$config $config ) : void
inherited

Lazy load constructs the module by determining the necessary fixes to create and then delegating to the populate() function.

Inherited from: \HTMLPurifier_HTMLModule_Tidy::setup()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_HTMLModule_XMLCommonAttributes

Package:

Represents an XHTML 1.1 module, with information on elements, tags and attributes.

Parent(s)
\HTMLPurifier_HTMLModule

Properties

Propertypublic  $attr_collections= 'array( 'Lang' => array( 'xml:lang' => 'LanguageCode', ) )'

Associative array of attribute collection names to attribute collection additions. More rarely used for adding attributes to the global collections. Example is the StyleAttribute module adding the style attribute to the Core. Corresponds to HTMLDefinition's attr_collections->info, since the object's data is only info, with extra behavior associated with it.

Default valuearray( 'Lang' => array( 'xml:lang' => 'LanguageCode', ) )Details
Type
n/a
Propertypublic  $content_sets= 'array()'
inherited

Associative array of content set names to content set additions.

Inherited from: \HTMLPurifier_HTMLModule::$$content_sets

This is commonly used to, say, add an A element to the Inline content set. This corresponds to an internal variable $content_sets and NOT info_content_sets member variable of HTMLDefinition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$content_sets  
Propertypublic  $defines_child_def= 'false'
inherited

Boolean flag that indicates whether or not getChildDef is implemented.

Inherited from: \HTMLPurifier_HTMLModule::$$defines_child_def

For optimization reasons: may save a call to a function. Be sure to set it if you do implement getChildDef(), otherwise it will have no effect!

Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$defines_child_def  
Propertypublic  $elements= 'array()'
inherited

Informally, a list of elements this module changes. Not used in any significant way.

Inherited from: \HTMLPurifier_HTMLModule::$$elements
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$elements  
Propertypublic  $info= 'array()'
inherited

Associative array of element names to element definitions.

Inherited from: \HTMLPurifier_HTMLModule::$$info

Some definitions may be incomplete, to be merged in later with the full definition.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info  
Propertypublic  $info_attr_transform_post= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed after validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_post
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_post  
Propertypublic  $info_attr_transform_pre= 'array()'
inherited

List of HTMLPurifier_AttrTransform to be performed before validation.

Inherited from: \HTMLPurifier_HTMLModule::$$info_attr_transform_pre
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_attr_transform_pre  
Propertypublic  $info_injector= 'array()'
inherited

List of HTMLPurifier_Injector to be performed during well-formedness fixing.

Inherited from: \HTMLPurifier_HTMLModule::$$info_injector

An injector will only be invoked if all of it's pre-requisites are met; if an injector fails setup, there will be no error; it will simply be silently disabled.

Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_injector  
Propertypublic  $info_tag_transform= 'array()'
inherited

Associative array of deprecated tag name to HTMLPurifier_TagTransform

Inherited from: \HTMLPurifier_HTMLModule::$$info_tag_transform
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$info_tag_transform  
Propertypublic  $name= ''XMLCommonAttributes''

Short unique string identifier of the module

Default value'XMLCommonAttributes'Details
Type
n/a
Propertypublic  $safe= 'true'
inherited

Boolean flag whether or not this module is safe. If it is not safe, all of its members are unsafe. Modules are safe by default (this might be slightly dangerous, but it doesn't make much sense to force HTML Purifier, which is based off of safe HTML, to explicitly say, "This is safe," even though there are modules which are "unsafe")

Inherited from: \HTMLPurifier_HTMLModule::$$safe
Default valuetrueDetails
Type
n/a
Inherited_from
\HTMLPurifier_HTMLModule::$$safe  
Note
Previously, safety could be applied at an element level granularity. We've removed this ability, so in order to add "unsafe" elements or attributes, a dedicated module with this property set to false must be used.  

Methods

methodpublicaddBlankElement( \$element $element ) : \Created
inherited

Convenience function that creates a totally blank, non-standalone element.

Inherited from: \HTMLPurifier_HTMLModule::addBlankElement()
Parameters
Name Type Description
$element \$element

Name of element to create

Returns
Type Description
\Created element
methodpublicaddElement( \$element $element, \$type $type, \$contents $contents, \$attr_includes $attr_includes = array(), \$attr $attr = array() ) : \Created
inherited

Convenience function that sets up a new element

Inherited from: \HTMLPurifier_HTMLModule::addElement()
Parameters
Name Type Description
$element \$element

Name of element to add

$type \$type

What content set should element be registered to? Set as false to skip this step.

$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

$attr_includes \$attr_includes

What attribute collections to register to element?

$attr \$attr

What unique attributes does the element define?

Returns
Type Description
\Created element definition object, so you can set advanced parameters
Details
Note
See ElementDef for in-depth descriptions of these parameters.  
methodpublicaddElementToContentSet( \Element $element, \Name $type ) : void
inherited

Convenience function that registers an element to a content set

Inherited from: \HTMLPurifier_HTMLModule::addElementToContentSet()
Parameters
Name Type Description
$element \Element

to register

$type \Name

content set (warning: case sensitive, usually upper-case first letter)

methodpublicgetChildDef( \$def $def ) : \HTMLPurifier_ChildDef
inherited

Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. There is a similar function in HTMLPurifier_HTMLDefinition.

Inherited from: \HTMLPurifier_HTMLModule::getChildDef()
Parameters
Name Type Description
$def \$def

HTMLPurifier_ElementDef instance

Returns
Type Description
\HTMLPurifier_ChildDef subclass
methodpublicmakeLookup( \$list $list ) : \Lookup
inherited

Convenience function that generates a lookup table with boolean true as value.

Inherited from: \HTMLPurifier_HTMLModule::makeLookup()
Parameters
Name Type Description
$list \$list

List of values to turn into a lookup

Returns
Type Description
\Lookup array equivalent of list
Details
Note
You can also pass an arbitrary number of arguments in place of the regular argument  
methodpublicmergeInAttrIncludes( \$attr $attr, \$attr_includes $attr_includes ) : void
inherited

Convenience function that merges a list of attribute includes into an attribute array.

Inherited from: \HTMLPurifier_HTMLModule::mergeInAttrIncludes()
Parameters
Name Type Description
$attr \$attr

Reference to attr array to modify

$attr_includes \$attr_includes

Array of includes / string include to merge in

methodpublicparseContents( \$contents $contents ) : void
inherited

Convenience function that transforms single-string contents into separate content model and content model type

Inherited from: \HTMLPurifier_HTMLModule::parseContents()
Parameters
Name Type Description
$contents \$contents

Allowed children in form of: "$content_model_type: $content_model"

Details
Note
If contents is an object, an array of two nulls will be returned, and the callee needs to take the original $contents and use it directly.  
methodpublicsetup( \$config $config ) : void
inherited

Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.

Inherited from: \HTMLPurifier_HTMLModule::setup()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

\HTMLPurifier_IDAccumulator

Package: SugarCRM

Component of HTMLPurifier_AttrContext that accumulates IDs to prevent dupes

Note
In Slashdot-speak, dupe means duplicate.  
Note
The default constructor does not accept $config or $context objects: use must use the static build() factory method to perform initialization.  

Properties

Propertypublic  $ids= 'array()'

Lookup table of IDs we've accumulated.

Default valuearray()Details
Type
n/a
Public
 

Methods

methodpublicadd( \$id $id ) : Bool

Add an ID to the lookup table.

Parameters
Name Type Description
$id \$id

ID to be added.

Returns
Type Description
Bool status, true if success, false if there's a dupe
methodpublicbuild( \$config $config, \$context $context ) : \Fully
static

Builds an IDAccumulator, also initializing the default blacklist

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

Returns
Type Description
\Fully initialized HTMLPurifier_IDAccumulator
methodpublicload( \$array_of_ids $array_of_ids ) : void

Load a list of IDs into the lookup table

Parameters
Name Type Description
$array_of_ids \$array_of_ids

Array of IDs to load

Details
Note
This function doesn't care about duplicates  

\HTMLPurifier_Injector

Package: SugarCRM

Injects tokens into the document while parsing for well-formedness.

This enables "formatter-like" functionality such as auto-paragraphing, smiley-ification and linkification to take place.

A note on how handlers create changes; this is done by assigning a new value to the $token reference. These values can take a variety of forms and are best described HTMLPurifier_Strategy_MakeWellFormed->processToken() documentation.

Children
\HTMLPurifier_Injector_AutoParagraph
\HTMLPurifier_Injector_DisplayLinkURI
\HTMLPurifier_Injector_Linkify
\HTMLPurifier_Injector_PurifierLinkify
\HTMLPurifier_Injector_RemoveEmpty
\HTMLPurifier_Injector_RemoveSpansWithoutAttributes
\HTMLPurifier_Injector_SafeObject
Todo
Allow injectors to request a re-run on their output. This would help if an operation is recursive.  

Properties

Propertyprotected  $currentNesting= ''

Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside"

Details
Type
n/a
Propertyprotected  $htmlDefinition= ''

Instance of HTMLPurifier_HTMLDefinition

Details
Type
n/a
Propertyprotected  $inputIndex= ''

Reference to InputIndex variable in Context. This is an integer array index for $this->inputTokens that indicates what token is currently being processed.

Details
Type
n/a
Propertyprotected  $inputTokens= ''

Reference to InputTokens variable in Context. This is an array list of the input tokens that are being processed.

Details
Type
n/a
Propertypublic  $name= ''

Advisory name of injector, this is for friendly error messages

Details
Type
n/a
Propertypublic  $needed= 'array()'

Array of elements and attributes this injector creates and therefore need to be allowed by the definition. Takes form of array('element' => array('attr', 'attr2'), 'element2')

Default valuearray()Details
Type
n/a
Propertyprotected  $rewind= 'false'

Index of inputTokens to rewind to.

Default valuefalseDetails
Type
n/a

Methods

methodpublicallowsElement( \$name $name ) : True

Tests if the context node allows a certain element

Parameters
Name Type Description
$name \$name

Name of element to test for

Returns
Type Description
True if element is allowed, false if it is not
methodprotectedbackward( \$i $i, \$current $current ) : void

Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.

Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodpubliccheckNeeded( \$config $config ) : Boolean

This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodprotectedcurrent( \$i $i, \$current $current ) : void

Initializes the iterator at the current position. Use in a do {} while; loop to force the _forward and _backward functions to start at the current location.

Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforward( \$i $i, \$current $current ) : void

Iterator function, which starts with the next token and continues until you reach the end of the input tokens.

Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforwardUntilEndToken(  $i,  $current,  $nesting ) : void

Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in.

Parameters
Name Type Description
$i
$current
$nesting
methodpublicgetRewind( ) : void

Retrieves rewind, and then unsets it.

methodpublichandleElement(  $token ) : void

Handler that is called when a start or empty token is processed

Parameters
Name Type Description
$token
methodpublichandleEnd(  $token ) : void

Handler that is called when an end token is processed

Parameters
Name Type Description
$token
methodpublichandleText(  $token ) : void

Handler that is called when a text token is processed

Parameters
Name Type Description
$token
methodpublicnotifyEnd(  $token ) : void

Notifier that is called when an end token is processed

Parameters
Name Type Description
$token
Details
Deprecated
 
Note
This differs from handlers in that the token is read-only  
methodpublicprepare( \$config $config, \$context $context ) : Boolean

Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()).

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodpublicrewind(  $index ) : void

Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully.

Parameters
Name Type Description
$index
Details
Warning
HTML Purifier will prevent you from fast-forwarding with this function.  

\HTMLPurifier_Injector_AutoParagraph

Package: SugarCRM

Injector that auto paragraphs text in the root node based on double-spacing.

This enables "formatter-like" functionality such as auto-paragraphing, smiley-ification and linkification to take place.

A note on how handlers create changes; this is done by assigning a new value to the $token reference. These values can take a variety of forms and are best described HTMLPurifier_Strategy_MakeWellFormed->processToken() documentation.

Parent(s)
\HTMLPurifier_Injector
Todo
Ensure all states are unit tested, including variations as well.  
Todo
Make a graph of the flow control for this Injector.  

Properties

Propertyprotected  $currentNesting= ''
inherited

Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside"

Inherited from: \HTMLPurifier_Injector::$$currentNesting
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$currentNesting  
Propertyprotected  $htmlDefinition= ''
inherited

Instance of HTMLPurifier_HTMLDefinition

Inherited from: \HTMLPurifier_Injector::$$htmlDefinition
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$htmlDefinition  
Propertyprotected  $inputIndex= ''
inherited

Reference to InputIndex variable in Context. This is an integer array index for $this->inputTokens that indicates what token is currently being processed.

Inherited from: \HTMLPurifier_Injector::$$inputIndex
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputIndex  
Propertyprotected  $inputTokens= ''
inherited

Reference to InputTokens variable in Context. This is an array list of the input tokens that are being processed.

Inherited from: \HTMLPurifier_Injector::$$inputTokens
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputTokens  
Propertypublic  $name= ''AutoParagraph''

Advisory name of injector, this is for friendly error messages

Default value'AutoParagraph'Details
Type
n/a
Propertypublic  $needed= 'array('p')'

Array of elements and attributes this injector creates and therefore need to be allowed by the definition. Takes form of array('element' => array('attr', 'attr2'), 'element2')

Default valuearray('p')Details
Type
n/a
Propertyprotected  $rewind= 'false'
inherited

Index of inputTokens to rewind to.

Inherited from: \HTMLPurifier_Injector::$$rewind
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$rewind  

Methods

methodprivate_checkNeedsP(  $current ) : void

Determines if a particular token requires an earlier inline token to get a paragraph. This should be used with _forwardUntilEndToken

Parameters
Name Type Description
$current
methodprivate_isInline(  $token ) : void

Returns true if passed token is inline (and, ergo, allowed in paragraph tags)

Parameters
Name Type Description
$token
methodprivate_pLookAhead( ) : void

Looks ahead in the token list and determines whether or not we need to insert a

tag.

methodprivate_pStart( ) : void

methodprivate_splitText( \$data $data, \$result $result ) : void

Splits up a text in paragraph tokens and appends them to the result stream that will replace the original

Parameters
Name Type Description
$data \$data

String text data that will be processed into paragraphs

$result \$result

Reference to array of tokens that the tags will be appended onto

methodpublicallowsElement( \$name $name ) : True
inherited

Tests if the context node allows a certain element

Inherited from: \HTMLPurifier_Injector::allowsElement()
Parameters
Name Type Description
$name \$name

Name of element to test for

Returns
Type Description
True if element is allowed, false if it is not
methodprotectedbackward( \$i $i, \$current $current ) : void
inherited

Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.

Inherited from: \HTMLPurifier_Injector::backward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodpubliccheckNeeded( \$config $config ) : Boolean
inherited

This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled.

Inherited from: \HTMLPurifier_Injector::checkNeeded()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodprotectedcurrent( \$i $i, \$current $current ) : void
inherited

Initializes the iterator at the current position. Use in a do {} while; loop to force the _forward and _backward functions to start at the current location.

Inherited from: \HTMLPurifier_Injector::current()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforward( \$i $i, \$current $current ) : void
inherited

Iterator function, which starts with the next token and continues until you reach the end of the input tokens.

Inherited from: \HTMLPurifier_Injector::forward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforwardUntilEndToken(  $i,  $current,  $nesting ) : void
inherited

Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in.

Inherited from: \HTMLPurifier_Injector::forwardUntilEndToken()
Parameters
Name Type Description
$i
$current
$nesting
methodpublicgetRewind( ) : void
inherited

Retrieves rewind, and then unsets it.

Inherited from: \HTMLPurifier_Injector::getRewind()
methodpublichandleElement(  $token ) : void

Handler that is called when a start or empty token is processed

Parameters
Name Type Description
$token
methodpublichandleEnd(  $token ) : void
inherited

Handler that is called when an end token is processed

Inherited from: \HTMLPurifier_Injector::handleEnd()
Parameters
Name Type Description
$token
methodpublichandleText(  $token ) : void

Handler that is called when a text token is processed

Parameters
Name Type Description
$token
methodpublicnotifyEnd(  $token ) : void
inherited

Notifier that is called when an end token is processed

Inherited from: \HTMLPurifier_Injector::notifyEnd()
Parameters
Name Type Description
$token
Details
Note
This differs from handlers in that the token is read-only  
methodpublicprepare( \$config $config, \$context $context ) : Boolean
inherited

Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()).

Inherited from: \HTMLPurifier_Injector::prepare()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodpublicrewind(  $index ) : void
inherited

Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully.

Inherited from: \HTMLPurifier_Injector::rewind()
Parameters
Name Type Description
$index
Details
Warning
HTML Purifier will prevent you from fast-forwarding with this function.  

\HTMLPurifier_Injector_DisplayLinkURI

Package: SugarCRM

Injector that displays the URL of an anchor instead of linking to it, in addition to showing the text of the link.

This enables "formatter-like" functionality such as auto-paragraphing, smiley-ification and linkification to take place.

A note on how handlers create changes; this is done by assigning a new value to the $token reference. These values can take a variety of forms and are best described HTMLPurifier_Strategy_MakeWellFormed->processToken() documentation.

Parent(s)
\HTMLPurifier_Injector

Properties

Propertyprotected  $currentNesting= ''
inherited

Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside"

Inherited from: \HTMLPurifier_Injector::$$currentNesting
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$currentNesting  
Propertyprotected  $htmlDefinition= ''
inherited

Instance of HTMLPurifier_HTMLDefinition

Inherited from: \HTMLPurifier_Injector::$$htmlDefinition
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$htmlDefinition  
Propertyprotected  $inputIndex= ''
inherited

Reference to InputIndex variable in Context. This is an integer array index for $this->inputTokens that indicates what token is currently being processed.

Inherited from: \HTMLPurifier_Injector::$$inputIndex
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputIndex  
Propertyprotected  $inputTokens= ''
inherited

Reference to InputTokens variable in Context. This is an array list of the input tokens that are being processed.

Inherited from: \HTMLPurifier_Injector::$$inputTokens
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputTokens  
Propertypublic  $name= ''DisplayLinkURI''

Advisory name of injector, this is for friendly error messages

Default value'DisplayLinkURI'Details
Type
n/a
Propertypublic  $needed= 'array('a')'

Array of elements and attributes this injector creates and therefore need to be allowed by the definition. Takes form of array('element' => array('attr', 'attr2'), 'element2')

Default valuearray('a')Details
Type
n/a
Propertyprotected  $rewind= 'false'
inherited

Index of inputTokens to rewind to.

Inherited from: \HTMLPurifier_Injector::$$rewind
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$rewind  

Methods

methodpublicallowsElement( \$name $name ) : True
inherited

Tests if the context node allows a certain element

Inherited from: \HTMLPurifier_Injector::allowsElement()
Parameters
Name Type Description
$name \$name

Name of element to test for

Returns
Type Description
True if element is allowed, false if it is not
methodprotectedbackward( \$i $i, \$current $current ) : void
inherited

Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.

Inherited from: \HTMLPurifier_Injector::backward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodpubliccheckNeeded( \$config $config ) : Boolean
inherited

This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled.

Inherited from: \HTMLPurifier_Injector::checkNeeded()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodprotectedcurrent( \$i $i, \$current $current ) : void
inherited

Initializes the iterator at the current position. Use in a do {} while; loop to force the _forward and _backward functions to start at the current location.

Inherited from: \HTMLPurifier_Injector::current()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforward( \$i $i, \$current $current ) : void
inherited

Iterator function, which starts with the next token and continues until you reach the end of the input tokens.

Inherited from: \HTMLPurifier_Injector::forward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforwardUntilEndToken(  $i,  $current,  $nesting ) : void
inherited

Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in.

Inherited from: \HTMLPurifier_Injector::forwardUntilEndToken()
Parameters
Name Type Description
$i
$current
$nesting
methodpublicgetRewind( ) : void
inherited

Retrieves rewind, and then unsets it.

Inherited from: \HTMLPurifier_Injector::getRewind()
methodpublichandleElement(  $token ) : void

Handler that is called when a start or empty token is processed

Parameters
Name Type Description
$token
methodpublichandleEnd(  $token ) : void

Handler that is called when an end token is processed

Parameters
Name Type Description
$token
methodpublichandleText(  $token ) : void
inherited

Handler that is called when a text token is processed

Inherited from: \HTMLPurifier_Injector::handleText()
Parameters
Name Type Description
$token
methodpublicnotifyEnd(  $token ) : void
inherited

Notifier that is called when an end token is processed

Inherited from: \HTMLPurifier_Injector::notifyEnd()
Parameters
Name Type Description
$token
Details
Note
This differs from handlers in that the token is read-only  
methodpublicprepare( \$config $config, \$context $context ) : Boolean
inherited

Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()).

Inherited from: \HTMLPurifier_Injector::prepare()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodpublicrewind(  $index ) : void
inherited

Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully.

Inherited from: \HTMLPurifier_Injector::rewind()
Parameters
Name Type Description
$index
Details
Warning
HTML Purifier will prevent you from fast-forwarding with this function.  

\HTMLPurifier_Injector_Linkify

Package: SugarCRM

Injector that converts http, https and ftp text URLs to actual links.

This enables "formatter-like" functionality such as auto-paragraphing, smiley-ification and linkification to take place.

A note on how handlers create changes; this is done by assigning a new value to the $token reference. These values can take a variety of forms and are best described HTMLPurifier_Strategy_MakeWellFormed->processToken() documentation.

Parent(s)
\HTMLPurifier_Injector

Properties

Propertyprotected  $currentNesting= ''
inherited

Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside"

Inherited from: \HTMLPurifier_Injector::$$currentNesting
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$currentNesting  
Propertyprotected  $htmlDefinition= ''
inherited

Instance of HTMLPurifier_HTMLDefinition

Inherited from: \HTMLPurifier_Injector::$$htmlDefinition
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$htmlDefinition  
Propertyprotected  $inputIndex= ''
inherited

Reference to InputIndex variable in Context. This is an integer array index for $this->inputTokens that indicates what token is currently being processed.

Inherited from: \HTMLPurifier_Injector::$$inputIndex
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputIndex  
Propertyprotected  $inputTokens= ''
inherited

Reference to InputTokens variable in Context. This is an array list of the input tokens that are being processed.

Inherited from: \HTMLPurifier_Injector::$$inputTokens
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputTokens  
Propertypublic  $name= ''Linkify''

Advisory name of injector, this is for friendly error messages

Default value'Linkify'Details
Type
n/a
Propertypublic  $needed= 'array('a' => array('href'))'

Array of elements and attributes this injector creates and therefore need to be allowed by the definition. Takes form of array('element' => array('attr', 'attr2'), 'element2')

Default valuearray('a' => array('href'))Details
Type
n/a
Propertyprotected  $rewind= 'false'
inherited

Index of inputTokens to rewind to.

Inherited from: \HTMLPurifier_Injector::$$rewind
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$rewind  

Methods

methodpublicallowsElement( \$name $name ) : True
inherited

Tests if the context node allows a certain element

Inherited from: \HTMLPurifier_Injector::allowsElement()
Parameters
Name Type Description
$name \$name

Name of element to test for

Returns
Type Description
True if element is allowed, false if it is not
methodprotectedbackward( \$i $i, \$current $current ) : void
inherited

Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.

Inherited from: \HTMLPurifier_Injector::backward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodpubliccheckNeeded( \$config $config ) : Boolean
inherited

This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled.

Inherited from: \HTMLPurifier_Injector::checkNeeded()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodprotectedcurrent( \$i $i, \$current $current ) : void
inherited

Initializes the iterator at the current position. Use in a do {} while; loop to force the _forward and _backward functions to start at the current location.

Inherited from: \HTMLPurifier_Injector::current()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforward( \$i $i, \$current $current ) : void
inherited

Iterator function, which starts with the next token and continues until you reach the end of the input tokens.

Inherited from: \HTMLPurifier_Injector::forward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforwardUntilEndToken(  $i,  $current,  $nesting ) : void
inherited

Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in.

Inherited from: \HTMLPurifier_Injector::forwardUntilEndToken()
Parameters
Name Type Description
$i
$current
$nesting
methodpublicgetRewind( ) : void
inherited

Retrieves rewind, and then unsets it.

Inherited from: \HTMLPurifier_Injector::getRewind()
methodpublichandleElement(  $token ) : void
inherited

Handler that is called when a start or empty token is processed

Inherited from: \HTMLPurifier_Injector::handleElement()
Parameters
Name Type Description
$token
methodpublichandleEnd(  $token ) : void
inherited

Handler that is called when an end token is processed

Inherited from: \HTMLPurifier_Injector::handleEnd()
Parameters
Name Type Description
$token
methodpublichandleText(  $token ) : void

Handler that is called when a text token is processed

Parameters
Name Type Description
$token
methodpublicnotifyEnd(  $token ) : void
inherited

Notifier that is called when an end token is processed

Inherited from: \HTMLPurifier_Injector::notifyEnd()
Parameters
Name Type Description
$token
Details
Note
This differs from handlers in that the token is read-only  
methodpublicprepare( \$config $config, \$context $context ) : Boolean
inherited

Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()).

Inherited from: \HTMLPurifier_Injector::prepare()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodpublicrewind(  $index ) : void
inherited

Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully.

Inherited from: \HTMLPurifier_Injector::rewind()
Parameters
Name Type Description
$index
Details
Warning
HTML Purifier will prevent you from fast-forwarding with this function.  

\HTMLPurifier_Injector_PurifierLinkify

Package: SugarCRM

Injector that converts configuration directive syntax %Namespace.Directive to links

This enables "formatter-like" functionality such as auto-paragraphing, smiley-ification and linkification to take place.

A note on how handlers create changes; this is done by assigning a new value to the $token reference. These values can take a variety of forms and are best described HTMLPurifier_Strategy_MakeWellFormed->processToken() documentation.

Parent(s)
\HTMLPurifier_Injector

Properties

Propertyprotected  $currentNesting= ''
inherited

Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside"

Inherited from: \HTMLPurifier_Injector::$$currentNesting
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$currentNesting  
Propertypublic  $docURL= ''
Details
Type
n/a
Propertyprotected  $htmlDefinition= ''
inherited

Instance of HTMLPurifier_HTMLDefinition

Inherited from: \HTMLPurifier_Injector::$$htmlDefinition
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$htmlDefinition  
Propertyprotected  $inputIndex= ''
inherited

Reference to InputIndex variable in Context. This is an integer array index for $this->inputTokens that indicates what token is currently being processed.

Inherited from: \HTMLPurifier_Injector::$$inputIndex
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputIndex  
Propertyprotected  $inputTokens= ''
inherited

Reference to InputTokens variable in Context. This is an array list of the input tokens that are being processed.

Inherited from: \HTMLPurifier_Injector::$$inputTokens
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputTokens  
Propertypublic  $name= ''PurifierLinkify''

Advisory name of injector, this is for friendly error messages

Default value'PurifierLinkify'Details
Type
n/a
Propertypublic  $needed= 'array('a' => array('href'))'

Array of elements and attributes this injector creates and therefore need to be allowed by the definition. Takes form of array('element' => array('attr', 'attr2'), 'element2')

Default valuearray('a' => array('href'))Details
Type
n/a
Propertyprotected  $rewind= 'false'
inherited

Index of inputTokens to rewind to.

Inherited from: \HTMLPurifier_Injector::$$rewind
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$rewind  

Methods

methodpublicallowsElement( \$name $name ) : True
inherited

Tests if the context node allows a certain element

Inherited from: \HTMLPurifier_Injector::allowsElement()
Parameters
Name Type Description
$name \$name

Name of element to test for

Returns
Type Description
True if element is allowed, false if it is not
methodprotectedbackward( \$i $i, \$current $current ) : void
inherited

Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.

Inherited from: \HTMLPurifier_Injector::backward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodpubliccheckNeeded( \$config $config ) : Boolean
inherited

This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled.

Inherited from: \HTMLPurifier_Injector::checkNeeded()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodprotectedcurrent( \$i $i, \$current $current ) : void
inherited

Initializes the iterator at the current position. Use in a do {} while; loop to force the _forward and _backward functions to start at the current location.

Inherited from: \HTMLPurifier_Injector::current()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforward( \$i $i, \$current $current ) : void
inherited

Iterator function, which starts with the next token and continues until you reach the end of the input tokens.

Inherited from: \HTMLPurifier_Injector::forward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforwardUntilEndToken(  $i,  $current,  $nesting ) : void
inherited

Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in.

Inherited from: \HTMLPurifier_Injector::forwardUntilEndToken()
Parameters
Name Type Description
$i
$current
$nesting
methodpublicgetRewind( ) : void
inherited

Retrieves rewind, and then unsets it.

Inherited from: \HTMLPurifier_Injector::getRewind()
methodpublichandleElement(  $token ) : void
inherited

Handler that is called when a start or empty token is processed

Inherited from: \HTMLPurifier_Injector::handleElement()
Parameters
Name Type Description
$token
methodpublichandleEnd(  $token ) : void
inherited

Handler that is called when an end token is processed

Inherited from: \HTMLPurifier_Injector::handleEnd()
Parameters
Name Type Description
$token
methodpublichandleText(  $token ) : void

Handler that is called when a text token is processed

Parameters
Name Type Description
$token
methodpublicnotifyEnd(  $token ) : void
inherited

Notifier that is called when an end token is processed

Inherited from: \HTMLPurifier_Injector::notifyEnd()
Parameters
Name Type Description
$token
Details
Note
This differs from handlers in that the token is read-only  
methodpublicprepare( \$config $config, \$context $context ) : Boolean

Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()).

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodpublicrewind(  $index ) : void
inherited

Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully.

Inherited from: \HTMLPurifier_Injector::rewind()
Parameters
Name Type Description
$index
Details
Warning
HTML Purifier will prevent you from fast-forwarding with this function.  

\HTMLPurifier_Injector_RemoveEmpty

Package:

Injects tokens into the document while parsing for well-formedness.

This enables "formatter-like" functionality such as auto-paragraphing, smiley-ification and linkification to take place.

A note on how handlers create changes; this is done by assigning a new value to the $token reference. These values can take a variety of forms and are best described HTMLPurifier_Strategy_MakeWellFormed->processToken() documentation.

Parent(s)
\HTMLPurifier_Injector

Properties

Propertypublic  $attrValidator= ''
Details
Type
n/a
Propertypublic  $config= ''
Details
Type
n/a
Propertyprivate  $context= ''
Details
Type
n/a
Propertyprotected  $currentNesting= ''
inherited

Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside"

Inherited from: \HTMLPurifier_Injector::$$currentNesting
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$currentNesting  
Propertyprotected  $htmlDefinition= ''
inherited

Instance of HTMLPurifier_HTMLDefinition

Inherited from: \HTMLPurifier_Injector::$$htmlDefinition
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$htmlDefinition  
Propertyprotected  $inputIndex= ''
inherited

Reference to InputIndex variable in Context. This is an integer array index for $this->inputTokens that indicates what token is currently being processed.

Inherited from: \HTMLPurifier_Injector::$$inputIndex
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputIndex  
Propertyprotected  $inputTokens= ''
inherited

Reference to InputTokens variable in Context. This is an array list of the input tokens that are being processed.

Inherited from: \HTMLPurifier_Injector::$$inputTokens
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputTokens  
Propertypublic  $name= ''
inherited

Advisory name of injector, this is for friendly error messages

Inherited from: \HTMLPurifier_Injector::$$name
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$name  
Propertypublic  $needed= 'array()'
inherited

Array of elements and attributes this injector creates and therefore need to be allowed by the definition. Takes form of array('element' => array('attr', 'attr2'), 'element2')

Inherited from: \HTMLPurifier_Injector::$$needed
Default valuearray()Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$needed  
Propertypublic  $removeNbsp= ''
Details
Type
n/a
Propertypublic  $removeNbspExceptions= ''
Details
Type
n/a
Propertyprotected  $rewind= 'false'
inherited

Index of inputTokens to rewind to.

Inherited from: \HTMLPurifier_Injector::$$rewind
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$rewind  

Methods

methodpublicallowsElement( \$name $name ) : True
inherited

Tests if the context node allows a certain element

Inherited from: \HTMLPurifier_Injector::allowsElement()
Parameters
Name Type Description
$name \$name

Name of element to test for

Returns
Type Description
True if element is allowed, false if it is not
methodprotectedbackward( \$i $i, \$current $current ) : void
inherited

Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.

Inherited from: \HTMLPurifier_Injector::backward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodpubliccheckNeeded( \$config $config ) : Boolean
inherited

This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled.

Inherited from: \HTMLPurifier_Injector::checkNeeded()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodprotectedcurrent( \$i $i, \$current $current ) : void
inherited

Initializes the iterator at the current position. Use in a do {} while; loop to force the _forward and _backward functions to start at the current location.

Inherited from: \HTMLPurifier_Injector::current()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforward( \$i $i, \$current $current ) : void
inherited

Iterator function, which starts with the next token and continues until you reach the end of the input tokens.

Inherited from: \HTMLPurifier_Injector::forward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforwardUntilEndToken(  $i,  $current,  $nesting ) : void
inherited

Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in.

Inherited from: \HTMLPurifier_Injector::forwardUntilEndToken()
Parameters
Name Type Description
$i
$current
$nesting
methodpublicgetRewind( ) : void
inherited

Retrieves rewind, and then unsets it.

Inherited from: \HTMLPurifier_Injector::getRewind()
methodpublichandleElement(  $token ) : void

Handler that is called when a start or empty token is processed

Parameters
Name Type Description
$token
methodpublichandleEnd(  $token ) : void
inherited

Handler that is called when an end token is processed

Inherited from: \HTMLPurifier_Injector::handleEnd()
Parameters
Name Type Description
$token
methodpublichandleText(  $token ) : void
inherited

Handler that is called when a text token is processed

Inherited from: \HTMLPurifier_Injector::handleText()
Parameters
Name Type Description
$token
methodpublicnotifyEnd(  $token ) : void
inherited

Notifier that is called when an end token is processed

Inherited from: \HTMLPurifier_Injector::notifyEnd()
Parameters
Name Type Description
$token
Details
Note
This differs from handlers in that the token is read-only  
methodpublicprepare( \$config $config, \$context $context ) : Boolean

Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()).

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodpublicrewind(  $index ) : void
inherited

Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully.

Inherited from: \HTMLPurifier_Injector::rewind()
Parameters
Name Type Description
$index
Details
Warning
HTML Purifier will prevent you from fast-forwarding with this function.  

\HTMLPurifier_Injector_RemoveSpansWithoutAttributes

Package: SugarCRM

Injector that removes spans with no attributes

This enables "formatter-like" functionality such as auto-paragraphing, smiley-ification and linkification to take place.

A note on how handlers create changes; this is done by assigning a new value to the $token reference. These values can take a variety of forms and are best described HTMLPurifier_Strategy_MakeWellFormed->processToken() documentation.

Parent(s)
\HTMLPurifier_Injector

Properties

Propertyprivate  $attrValidator= ''
Details
Type
n/a
Propertyprivate  $config= ''

Used by AttrValidator

Details
Type
n/a
Propertyprivate  $context= ''
Details
Type
n/a
Propertyprotected  $currentNesting= ''
inherited

Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside"

Inherited from: \HTMLPurifier_Injector::$$currentNesting
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$currentNesting  
Propertyprotected  $htmlDefinition= ''
inherited

Instance of HTMLPurifier_HTMLDefinition

Inherited from: \HTMLPurifier_Injector::$$htmlDefinition
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$htmlDefinition  
Propertyprotected  $inputIndex= ''
inherited

Reference to InputIndex variable in Context. This is an integer array index for $this->inputTokens that indicates what token is currently being processed.

Inherited from: \HTMLPurifier_Injector::$$inputIndex
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputIndex  
Propertyprotected  $inputTokens= ''
inherited

Reference to InputTokens variable in Context. This is an array list of the input tokens that are being processed.

Inherited from: \HTMLPurifier_Injector::$$inputTokens
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputTokens  
Propertypublic  $name= ''RemoveSpansWithoutAttributes''

Advisory name of injector, this is for friendly error messages

Default value'RemoveSpansWithoutAttributes'Details
Type
n/a
Propertypublic  $needed= 'array('span')'

Array of elements and attributes this injector creates and therefore need to be allowed by the definition. Takes form of array('element' => array('attr', 'attr2'), 'element2')

Default valuearray('span')Details
Type
n/a
Propertyprotected  $rewind= 'false'
inherited

Index of inputTokens to rewind to.

Inherited from: \HTMLPurifier_Injector::$$rewind
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$rewind  

Methods

methodpublicallowsElement( \$name $name ) : True
inherited

Tests if the context node allows a certain element

Inherited from: \HTMLPurifier_Injector::allowsElement()
Parameters
Name Type Description
$name \$name

Name of element to test for

Returns
Type Description
True if element is allowed, false if it is not
methodprotectedbackward( \$i $i, \$current $current ) : void
inherited

Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.

Inherited from: \HTMLPurifier_Injector::backward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodpubliccheckNeeded( \$config $config ) : Boolean
inherited

This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled.

Inherited from: \HTMLPurifier_Injector::checkNeeded()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodprotectedcurrent( \$i $i, \$current $current ) : void
inherited

Initializes the iterator at the current position. Use in a do {} while; loop to force the _forward and _backward functions to start at the current location.

Inherited from: \HTMLPurifier_Injector::current()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforward( \$i $i, \$current $current ) : void
inherited

Iterator function, which starts with the next token and continues until you reach the end of the input tokens.

Inherited from: \HTMLPurifier_Injector::forward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforwardUntilEndToken(  $i,  $current,  $nesting ) : void
inherited

Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in.

Inherited from: \HTMLPurifier_Injector::forwardUntilEndToken()
Parameters
Name Type Description
$i
$current
$nesting
methodpublicgetRewind( ) : void
inherited

Retrieves rewind, and then unsets it.

Inherited from: \HTMLPurifier_Injector::getRewind()
methodpublichandleElement(  $token ) : void

Handler that is called when a start or empty token is processed

Parameters
Name Type Description
$token
methodpublichandleEnd(  $token ) : void

Handler that is called when an end token is processed

Parameters
Name Type Description
$token
methodpublichandleText(  $token ) : void
inherited

Handler that is called when a text token is processed

Inherited from: \HTMLPurifier_Injector::handleText()
Parameters
Name Type Description
$token
methodpublicnotifyEnd(  $token ) : void
inherited

Notifier that is called when an end token is processed

Inherited from: \HTMLPurifier_Injector::notifyEnd()
Parameters
Name Type Description
$token
Details
Note
This differs from handlers in that the token is read-only  
methodpublicprepare( \$config $config, \$context $context ) : Boolean

Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()).

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodpublicrewind(  $index ) : void
inherited

Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully.

Inherited from: \HTMLPurifier_Injector::rewind()
Parameters
Name Type Description
$index
Details
Warning
HTML Purifier will prevent you from fast-forwarding with this function.  

\HTMLPurifier_Injector_SafeObject

Package: SugarCRM

Adds important param elements to inside of object in order to make things safe.

This enables "formatter-like" functionality such as auto-paragraphing, smiley-ification and linkification to take place.

A note on how handlers create changes; this is done by assigning a new value to the $token reference. These values can take a variety of forms and are best described HTMLPurifier_Strategy_MakeWellFormed->processToken() documentation.

Parent(s)
\HTMLPurifier_Injector

Properties

Propertyprotected  $addParam= 'array( 'allowScriptAccess' => 'never', 'allowNetworking' => 'internal', )'
Default valuearray( 'allowScriptAccess' => 'never', 'allowNetworking' => 'internal', )Details
Type
n/a
Propertyprotected  $allowedParam= 'array( 'wmode' => true, 'movie' => true, 'flashvars' => true, 'src' => true, 'allowFullScreen' => true, // if omitted, assume to be 'false' )'
Default valuearray( 'wmode' => true, 'movie' => true, 'flashvars' => true, 'src' => true, 'allowFullScreen' => true, // if omitted, assume to be 'false' )Details
Type
n/a
Propertyprotected  $currentNesting= ''
inherited

Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside"

Inherited from: \HTMLPurifier_Injector::$$currentNesting
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$currentNesting  
Propertyprotected  $htmlDefinition= ''
inherited

Instance of HTMLPurifier_HTMLDefinition

Inherited from: \HTMLPurifier_Injector::$$htmlDefinition
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$htmlDefinition  
Propertyprotected  $inputIndex= ''
inherited

Reference to InputIndex variable in Context. This is an integer array index for $this->inputTokens that indicates what token is currently being processed.

Inherited from: \HTMLPurifier_Injector::$$inputIndex
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputIndex  
Propertyprotected  $inputTokens= ''
inherited

Reference to InputTokens variable in Context. This is an array list of the input tokens that are being processed.

Inherited from: \HTMLPurifier_Injector::$$inputTokens
Details
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$inputTokens  
Propertypublic  $name= ''SafeObject''

Advisory name of injector, this is for friendly error messages

Default value'SafeObject'Details
Type
n/a
Propertypublic  $needed= 'array('object', 'param')'

Array of elements and attributes this injector creates and therefore need to be allowed by the definition. Takes form of array('element' => array('attr', 'attr2'), 'element2')

Default valuearray('object', 'param')Details
Type
n/a
Propertyprotected  $objectStack= 'array()'
Default valuearray()Details
Type
n/a
Propertyprotected  $paramStack= 'array()'
Default valuearray()Details
Type
n/a
Propertyprotected  $rewind= 'false'
inherited

Index of inputTokens to rewind to.

Inherited from: \HTMLPurifier_Injector::$$rewind
Default valuefalseDetails
Type
n/a
Inherited_from
\HTMLPurifier_Injector::$$rewind  

Methods

methodpublicallowsElement( \$name $name ) : True
inherited

Tests if the context node allows a certain element

Inherited from: \HTMLPurifier_Injector::allowsElement()
Parameters
Name Type Description
$name \$name

Name of element to test for

Returns
Type Description
True if element is allowed, false if it is not
methodprotectedbackward( \$i $i, \$current $current ) : void
inherited

Iterator function, starts with the previous token and continues until you reach the beginning of input tokens.

Inherited from: \HTMLPurifier_Injector::backward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodpubliccheckNeeded( \$config $config ) : Boolean
inherited

This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled.

Inherited from: \HTMLPurifier_Injector::checkNeeded()
Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodprotectedcurrent( \$i $i, \$current $current ) : void
inherited

Initializes the iterator at the current position. Use in a do {} while; loop to force the _forward and _backward functions to start at the current location.

Inherited from: \HTMLPurifier_Injector::current()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforward( \$i $i, \$current $current ) : void
inherited

Iterator function, which starts with the next token and continues until you reach the end of the input tokens.

Inherited from: \HTMLPurifier_Injector::forward()
Parameters
Name Type Description
$i \$i

Current integer index variable for inputTokens

$current \$current

Current token variable. Do NOT use $token, as that variable is also a reference

Details
Warning
Please prevent previous references from interfering with this functions by setting $i = null beforehand!  
methodprotectedforwardUntilEndToken(  $i,  $current,  $nesting ) : void
inherited

Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in.

Inherited from: \HTMLPurifier_Injector::forwardUntilEndToken()
Parameters
Name Type Description
$i
$current
$nesting
methodpublicgetRewind( ) : void
inherited

Retrieves rewind, and then unsets it.

Inherited from: \HTMLPurifier_Injector::getRewind()
methodpublichandleElement(  $token ) : void

Handler that is called when a start or empty token is processed

Parameters
Name Type Description
$token
methodpublichandleEnd(  $token ) : void

Handler that is called when an end token is processed

Parameters
Name Type Description
$token
methodpublichandleText(  $token ) : void
inherited

Handler that is called when a text token is processed

Inherited from: \HTMLPurifier_Injector::handleText()
Parameters
Name Type Description
$token
methodpublicnotifyEnd(  $token ) : void
inherited

Notifier that is called when an end token is processed

Inherited from: \HTMLPurifier_Injector::notifyEnd()
Parameters
Name Type Description
$token
Details
Note
This differs from handlers in that the token is read-only  
methodpublicprepare( \$config $config, \$context $context ) : Boolean

Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()).

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

Returns
Type Description
Boolean false if success, string of missing needed element/attribute if failure
methodpublicrewind(  $index ) : void
inherited

Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully.

Inherited from: \HTMLPurifier_Injector::rewind()
Parameters
Name Type Description
$index
Details
Warning
HTML Purifier will prevent you from fast-forwarding with this function.  

\HTMLPurifier_Language

Package: SugarCRM

Represents a language and defines localizable string formatting and other functions, as well as the localized messages for HTML Purifier.

Children
\HTMLPurifier_Language_en_x_test

Properties

Propertypublic  $_loaded= 'false'

Has the language object been loaded yet?

Default valuefalseDetails
Type
n/a
Todo
Make it private, fix usage in HTMLPurifier_LanguageTest  
Propertypublic  $code= ''en''

ISO 639 language code of language. Prefers shortest possible version

Default value'en'Details
Type
n/a
Propertyprotected  $config= ''

Instances of HTMLPurifier_Config and HTMLPurifier_Context

Details
Type
n/a
Propertypublic  $context= ''

Instances of HTMLPurifier_Config and HTMLPurifier_Context

Details
Type
n/a
Propertypublic  $error= 'false'

True if no message file was found for this language, so English is being used instead. Check this if you'd like to notify the user that they've used a non-supported language.

Default valuefalseDetails
Type
n/a
Propertypublic  $errorNames= 'array()'

Array of localizable error codes

Default valuearray()Details
Type
n/a
Propertypublic  $fallback= 'false'

Fallback language code

Default valuefalseDetails
Type
n/a
Propertypublic  $messages= 'array()'

Array of localizable messages

Default valuearray()Details
Type
n/a

Methods

methodpublic__construct(  $config,  $context ) : void

Parameters
Name Type Description
$config
$context
methodpublicformatMessage( \$key $key, \$args $args = array() ) : string

Formats a localised message with passed parameters

Parameters
Name Type Description
$key \$key

string identifier of message

$args \$args

Parameters to substitute in

Returns
Type Description
string localised message
Details
Todo
Implement conditionals? Right now, some messages make reference to line numbers, but those aren't always available  
methodpublicgetErrorName( \$int $int ) : string

Retrieves a localised error name.

Parameters
Name Type Description
$int \$int

integer error number, corresponding to PHP's error reporting

Returns
Type Description
string localised message
methodpublicgetMessage( \$key $key ) : string

Retrieves a localised message.

Parameters
Name Type Description
$key \$key

string identifier of message

Returns
Type Description
string localised message
methodpubliclistify(  $array ) : void

Converts an array list into a string readable representation

Parameters
Name Type Description
$array
methodpublicload( ) : void

Loads language object with necessary info from factory cache

Details
Note
This is a lazy loader  

\HTMLPurifier_LanguageFactory

Package: SugarCRM

Class responsible for generating HTMLPurifier_Language objects, managing caching and fallbacks.

Note
Thanks to MediaWiki for the general logic, although this version has been entirely rewritten  
Todo
Serialized cache for languages  

Properties

Propertypublic  $cache= ''

Cache of language code information used to load HTMLPurifier_Language objects Structure is: $factory->cache[$language_code][$key] = $value

Details
Type
n/a
Value
array map  
Propertyprotected  $dir= ''

Cached copy of dirname(__FILE__), directory of current file without trailing slash

Details
Type
n/a
Value
string filename  
Propertypublic  $keys= 'array('fallback', 'messages', 'errorNames')'

Valid keys in the HTMLPurifier_Language object. Designates which variables to slurp out of a message file.

Default valuearray('fallback', 'messages', 'errorNames')Details
Type
n/a
Value
array list  
Propertyprotected  $mergeable_keys_list= 'array()'

Keys whose contents are a list and can be merged

Default valuearray()Details
Type
n/a
Value
array lookup  
Propertyprotected  $mergeable_keys_map= 'array('messages' => true, 'errorNames' => true)'

Keys whose contents are a hash map and can be merged

Default valuearray('messages' => true, 'errorNames' => true)Details
Type
n/a
Value
array lookup  
Propertyprotected  $validator= ''

Instance of HTMLPurifier_AttrDef_Lang to validate language codes

Details
Type
n/a
Value
object HTMLPurifier_AttrDef_Lang  

Methods

methodpubliccreate( \$config $config, \$context $context, \$code $code = false ) : void

Creates a language object, handles class fallbacks

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

$context \$context

Instance of HTMLPurifier_Context

$code \$code

Code to override configuration with. Private parameter.

methodpublicgetFallbackFor( \$code $code ) : void

Returns the fallback language for language

Parameters
Name Type Description
$code \$code

string language code

Details
Note
Loads the original language into cache  
methodpublicinstance( \$prototype $prototype = null ) : void
static

Retrieve sole instance of the factory.

Parameters
Name Type Description
$prototype \$prototype

Optional prototype to overload sole instance with, or bool true to reset to default factory.

methodpublicloadLanguage( \$code $code ) : void

Loads language into the cache, handles message file and fallbacks

Parameters
Name Type Description
$code \$code

string language code

methodpublicsetup( ) : void

Sets up the singleton, much like a constructor

Details
Note
Prevents people from getting this outside of the singleton  

\HTMLPurifier_Length

Package: SugarCRM

Represents a measurable length, with a string numeric magnitude and a unit. This object is immutable.

Properties

Propertyprotected  $allowedUnits= 'array( 'em' => true, 'ex' => true, 'px' => true, 'in' => true, 'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true )'
static

Lookup array of units recognized by CSS 2.1

Default valuearray( 'em' => true, 'ex' => true, 'px' => true, 'in' => true, 'cm' => true, 'mm' => true, 'pt' => true, 'pc' => true )Details
Type
n/a
Propertyprotected  $isValid= ''

Whether or not this length is valid. Null if not calculated yet.

Details
Type
n/a
Propertyprotected  $n= ''

String numeric magnitude.

Details
Type
n/a
Propertyprotected  $unit= ''

String unit. False is permitted if $n = 0.

Details
Type
n/a

Methods

methodpublic__construct( \number $n = '0', string $u = false ) : void

Parameters
Name Type Description
$n \number

Magnitude

$u string

Unit

methodpubliccompareTo(  $l ) : void

Compares two lengths, and returns 1 if greater, -1 if less and 0 if equal.

Parameters
Name Type Description
$l
Details
Warning
If both values are too large or small, this calculation will not work properly  
methodpublicgetN( ) : void

Retrieves string numeric magnitude.

methodpublicgetUnit( ) : void

Retrieves string unit.

methodpublicisValid( ) : void

Returns true if this length unit is valid.

methodpublicmake( string $s ) : void
static

Parameters
Name Type Description
$s string

Unit string, like '2em' or '3.4in'

Details
Warning
Does not perform validation.  
methodpublictoString( ) : void

Returns string representation of number.

methodprotectedvalidate( ) : void

Validates the number and unit.

\HTMLPurifier_Lexer

Package: SugarCRM

Forgivingly lexes HTML (SGML-style) markup into tokens.

A lexer parses a string of SGML-style markup and converts them into corresponding tokens. It doesn't check for well-formedness, although its internal mechanism may make this automatic (such as the case of HTMLPurifier_Lexer_DOMLex). There are several implementations to choose from.

A lexer is HTML-oriented: it might work with XML, but it's not recommended, as we adhere to a subset of the specification for optimization reasons. This might change in the future. Also, most tokenizers are not expected to handle DTDs or PIs.

This class should not be directly instantiated, but you may use create() to retrieve a default copy of the lexer. Being a supertype, this class does not actually define any implementation, but offers commonly used convenience functions for subclasses.

Children
\HTMLPurifier_Lexer_DOMLex
\HTMLPurifier_Lexer_DirectLex
\HTMLPurifier_Lexer_PEARSax3
Note
The unit tests will instantiate this class for testing purposes, as many of the utility functions require a class to be instantiated. This means that, even though this class is not runnable, it will not be declared abstract.  
Note
We use tokens rather than create a DOM representation because DOM would:  
Par
 
Par
-# Require more processing and memory to create, -# Is not streamable, and -# Has the entire document structure (html and body not needed).  
Par
However, DOM is helpful in that it makes it easy to move around nodes without a lot of lookaheads to see when a tag is closed. This is a limitation of the token system and some workarounds would be nice.  

Properties

Propertyprotected  $_special_entity2str= 'array( '&quot;' => '"', '&amp;' => '&', '&lt;' => '<', '&gt;' => '>', '&#39;' => "'", '&#039;' => "'", '&#x27;' => "'" )'

Most common entity to raw value conversion table for special entities.

Default valuearray( '&quot;' => '"', '&amp;' => '&', '&lt;' => '<', '&gt;' => '>', '&#39;' => "'", '&#039;' => "'", '&#x27;' => "'" )Details
Type
n/a
Propertypublic  $tracksLineNumbers= 'false'

Whether or not this lexer implements line-number/column-number tracking.

If it does, set to true.

Default valuefalseDetails
Type
n/a

Methods

methodprotectedCDATACallback(  $matches ) : void
static

Callback function for escapeCDATA() that does the work.

Parameters
Name Type Description
$matches
Details
Params
$matches PCRE matches array, with index 0 the entire match and 1 the inside of the CDATA section.  
Returns
Escaped internals of the CDATA section.  
Warning
Though this is public in order to let the callback happen, calling it directly is not recommended.  
methodpublic__construct( ) : void

methodpubliccreate( \$config $config ) : \Concrete
static

Retrieves or sets the default Lexer as a Prototype Factory.

By default HTMLPurifier_Lexer_DOMLex will be returned. There are a few exceptions involving special features that only DirectLex implements.

Parameters
Name Type Description
$config \$config

Instance of HTMLPurifier_Config

Returns
Type Description
\Concrete lexer.
Details
Note
The behavior of this class has changed, rather than accepting a prototype object, it now accepts a configuration object. To specify your own prototype, set %Core.LexerImpl to it. This change in behavior de-singletonizes the lexer object.  
methodprotectedescapeCDATA( \$string $string ) : void
static

Translates CDATA sections into regular sections (through escaping).

Parameters
Name Type Description
$string \$string

HTML string to process.

Details
Returns
HTML with CDATA sections escaped.  
methodprotectedescapeCommentedCDATA(  $string ) : void
static

Special CDATA case that is especially convoluted for