API - XOOPS 2.5.11 Beta 2
By monxoops.fr
HTMLPurifier_EntityParser Class Reference

Public Member Functions

 __construct ()
 
 substituteTextEntities ($string)
 
 substituteAttrEntities ($string)
 
 substituteNonSpecialEntities ($string)
 
 substituteSpecialEntities ($string)
 

Protected Member Functions

 entityCallback ($matches)
 
 nonSpecialEntityCallback ($matches)
 
 specialEntityCallback ($matches)
 

Protected Attributes

 $_entity_lookup
 
 $_textEntitiesRegex
 
 $_attrEntitiesRegex
 
 $_semiOptionalPrefixRegex
 
 $_substituteEntitiesRegex
 
 $_special_dec2str
 
 $_special_ent2dec
 

Detailed Description

Handles referencing and derefencing character entities

Constructor & Destructor Documentation

◆ __construct()

__construct ( )

Member Function Documentation

◆ entityCallback()

entityCallback (   $matches)
protected

Callback function for substituteNonSpecialEntities() that does the work.

Parameters
array$matchesPCRE matches array, with 0 the entire match, and either index 1, 2 or 3 set with a hex value, dec value, or string (respectively).
Returns
string Replacement string.
Here is the call graph for this function:

◆ nonSpecialEntityCallback()

nonSpecialEntityCallback (   $matches)
protected

Callback function for substituteNonSpecialEntities() that does the work.

Parameters
array$matchesPCRE matches array, with 0 the entire match, and either index 1, 2 or 3 set with a hex value, dec value, or string (respectively).
Returns
string Replacement string.
Here is the call graph for this function:

◆ specialEntityCallback()

specialEntityCallback (   $matches)
protected

Callback function for substituteSpecialEntities() that does the work.

This callback has same syntax as nonSpecialEntityCallback().

Parameters
array$matchesPCRE-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).
Returns
string Replacement string.

◆ substituteAttrEntities()

substituteAttrEntities (   $string)

Substitute entities with the parsed equivalents. Use this on attribute contents in documents.

Parameters
string$stringString to have entities parsed.
Returns
string Parsed string.

◆ substituteNonSpecialEntities()

substituteNonSpecialEntities (   $string)

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
string$stringString to have non-special entities parsed.
Returns
string Parsed string.

◆ substituteSpecialEntities()

substituteSpecialEntities (   $string)

Substitutes only special entities with their parsed equivalents.

@notice We try to avoid calling this function because otherwise, it would have to be called a lot (for every parsed section).

Parameters
string$stringString to have non-special entities parsed.
Returns
string Parsed string.

◆ substituteTextEntities()

substituteTextEntities (   $string)

Substitute entities with the parsed equivalents. Use this on textual data in an HTML document (as opposed to attributes.)

Parameters
string$stringString to have entities parsed.
Returns
string Parsed string.

Field Documentation

◆ $_attrEntitiesRegex

$_attrEntitiesRegex
protected

Callback regex string for entities in attributes. @type string

◆ $_entity_lookup

$_entity_lookup
protected

Reference to entity lookup table. @type HTMLPurifier_EntityLookup

◆ $_semiOptionalPrefixRegex

$_semiOptionalPrefixRegex
protected

Tests if the beginning of a string is a semi-optional regex

◆ $_special_dec2str

$_special_dec2str
protected
Initial value:
=
array(
34 => '"',
38 => '&',
39 => "'",
60 => '<',
62 => '>'
)

Decimal to parsed string conversion table for special entities. @type array

◆ $_special_ent2dec

$_special_ent2dec
protected
Initial value:
=
array(
'quot' => 34,
'amp' => 38,
'lt' => 60,
'gt' => 62
)

Stripped entity names to decimal conversion table for special entities. @type array

◆ $_substituteEntitiesRegex

$_substituteEntitiesRegex
protected
Initial value:
=
'/&(?:[#]x([a-fA-F0-9]+)|[#]0*(\d+)|([A-Za-z_:][A-Za-z0-9.\-_:]*));?/'

Callback regex string for parsing entities. @type string

◆ $_textEntitiesRegex

$_textEntitiesRegex
protected

Callback regex string for entities in text. @type string


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