Class HTMLPurifier_EntityParser
Inheritance | HTMLPurifier_EntityParser |
---|
Handles referencing and derefencing character entities
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$_entity_lookup | Reference to entity lookup table. | HTMLPurifier_EntityParser | |
$_special_dec2str | Decimal to parsed string conversion table for special entities. | HTMLPurifier_EntityParser | |
$_special_ent2dec | Stripped entity names to decimal conversion table for special entities. | HTMLPurifier_EntityParser | |
$_substituteEntitiesRegex | Callback regex string for parsing entities. | HTMLPurifier_EntityParser |
Public Methods
Method | Description | Defined By |
---|---|---|
substituteNonSpecialEntities() | 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. | HTMLPurifier_EntityParser |
substituteSpecialEntities() | Substitutes only special entities with their parsed equivalents. | HTMLPurifier_EntityParser |
Protected Methods
Method | Description | Defined By |
---|---|---|
nonSpecialEntityCallback() | Callback function for substituteNonSpecialEntities() that does the work. | HTMLPurifier_EntityParser |
specialEntityCallback() | Callback function for substituteSpecialEntities() that does the work. | HTMLPurifier_EntityParser |
Property Details
protected $_substituteEntitiesRegex = '/&(?:[#]x([a-fA-F0-9]+)|[#]0*(\d+)|([A-Za-z_:][A-Za-z0-9.\-_:]*));?/'
Method Details
Callback function for substituteNonSpecialEntities() that does the work.
protected string nonSpecialEntityCallback ( $matches ) | ||
$matches | array | PCRE matches array, with 0 the entire match, and
|
return | string | Replacement string. |
---|
Callback function for substituteSpecialEntities() that does the work.
This callback has same syntax as nonSpecialEntityCallback().
protected string specialEntityCallback ( $matches ) | ||
$matches | array | PCRE-style matches array, with 0 the entire match, and
|
return | string | Replacement 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.
public string substituteNonSpecialEntities ( $string ) | ||
$string | string | String to have non-special entities parsed. |
return | string | Parsed string. |
---|
Substitutes only special entities with their parsed equivalents.
public string substituteSpecialEntities ( $string ) | ||
$string | string | String to have non-special entities parsed. |
return | string | Parsed string. |
---|