Class HTMLPurifier_EntityParser

Description

Handles referencing and derefencing character entities

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


	
			
Variable Summary
Method Summary
Replacement nonSpecialEntityCallback ($matches $matches)
Replacement specialEntityCallback ($matches $matches)
Parsed substituteNonSpecialEntities ($string $string)
Parsed substituteSpecialEntities ($string $string)
Variables
mixed $_entity_lookup (line 3317)

Reference to entity lookup table.

  • access: protected
mixed $_special_dec2str = array(
34 => '"',
38 => '&',
39 => "'",
60 => '<',
62 => '>'
)
(line 3330)

Decimal to parsed string conversion table for special entities.

  • access: protected
mixed $_special_ent2dec = array(
'quot' => 34,
'amp' => 38,
'lt' => 60,
'gt' => 62
)
(line 3342)

Stripped entity names to decimal conversion table for special entities.

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

Callback regex string for parsing entities.

  • access: protected
Methods
nonSpecialEntityCallback (line 3376)

Callback function for substituteNonSpecialEntities() that does the work.

  • return: string.
  • access: protected
Replacement nonSpecialEntityCallback ($matches $matches)
  • $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).
specialEntityCallback (line 3427)

Callback function for substituteSpecialEntities() that does the work.

This callback has same syntax as nonSpecialEntityCallback().

  • return: string.
  • access: protected
Replacement specialEntityCallback ($matches $matches)
  • $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).
substituteNonSpecialEntities (line 3358)

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.

  • return: string.
  • access: public
Parsed substituteNonSpecialEntities ($string $string)
  • $string $string: String to have non-special entities parsed.
substituteSpecialEntities (line 3410)

Substitutes only special entities with their parsed equivalents.

  • return: string.
  • access: public
Parsed substituteSpecialEntities ($string $string)
  • $string $string: String to have non-special entities parsed.

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