PHP Class HTMLPurifier_EntityParser, yii

显示文件 Open project: yiisoft/yii

Protected Properties

Property Type Description
$_entity_lookup Reference to entity lookup table.
$_special_dec2str Decimal to parsed string conversion table for special entities.
$_special_ent2dec Stripped entity names to decimal conversion table for special entities.
$_substituteEntitiesRegex Callback regex string for parsing entities.

Public Methods

Method Description
substituteNonSpecialEntities ( string $string ) : 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.
substituteSpecialEntities ( string $string ) : string Substitutes only special entities with their parsed equivalents.

Protected Methods

Method Description
nonSpecialEntityCallback ( array $matches ) : string Callback function for substituteNonSpecialEntities() that does the work.
specialEntityCallback ( array $matches ) : string Callback function for substituteSpecialEntities() that does the work.

Method Details

nonSpecialEntityCallback() protected method

Callback function for substituteNonSpecialEntities() that does the work.
protected nonSpecialEntityCallback ( array $matches ) : string
$matches array 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).
return string Replacement string.

specialEntityCallback() protected method

This callback has same syntax as nonSpecialEntityCallback().
protected specialEntityCallback ( array $matches ) : string
$matches array 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).
return string Replacement string.

substituteNonSpecialEntities() public method

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 substituteNonSpecialEntities ( string $string ) : string
$string string String to have non-special entities parsed.
return string Parsed string.

substituteSpecialEntities() public method

Substitutes only special entities with their parsed equivalents.
public substituteSpecialEntities ( string $string ) : string
$string string String to have non-special entities parsed.
return string Parsed string.

Property Details

$_entity_lookup protected_oe property

Reference to entity lookup table.
protected $_entity_lookup

$_special_dec2str protected_oe property

Decimal to parsed string conversion table for special entities.
protected $_special_dec2str

$_special_ent2dec protected_oe property

Stripped entity names to decimal conversion table for special entities.
protected $_special_ent2dec

$_substituteEntitiesRegex protected_oe property

Callback regex string for parsing entities.
protected $_substituteEntitiesRegex