Class HTMLPurifier_Strategy_MakeWellFormed

InheritanceHTMLPurifier_Strategy_MakeWellFormed » HTMLPurifier_Strategy

Takes tokens makes them well-formed (balance end tags, etc.)

Specification of the armor attributes this strategy uses:

 - MakeWellFormed_TagClosedError: This armor field is used to
   suppress tag closed errors for certain tokens [TagClosedSuppress],
   in particular, if a tag was generated automatically by HTML
   Purifier, we may rely on our infrastructure to close it for us
   and shouldn't report an error to the user [TagClosedAuto].

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$config Current instance of HTMLPurifier_Config. HTMLPurifier_Strategy_MakeWellFormed
$context Current instance of HTMLPurifier_Context. HTMLPurifier_Strategy_MakeWellFormed
$injectors Injectors active in this stream processing. HTMLPurifier_Strategy_MakeWellFormed
$stack Current nesting of elements. HTMLPurifier_Strategy_MakeWellFormed
$token Current token. HTMLPurifier_Strategy_MakeWellFormed
$tokens Array stream of tokens being processed. HTMLPurifier_Strategy_MakeWellFormed
$zipper Zipper managing the true state. HTMLPurifier_Strategy_MakeWellFormed

Public Methods

Hide inherited methods

MethodDescriptionDefined By
execute() HTMLPurifier_Strategy_MakeWellFormed

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
processToken() Processes arbitrary token values for complicated substitution patterns. HTMLPurifier_Strategy_MakeWellFormed

Property Details

$config protected property
protected $config null
$context protected property
protected $context null
$injectors protected property
protected $injectors null
$stack protected property
protected $stack null
$token protected property
protected $token null
$tokens protected property
protected $tokens null
$zipper protected property
protected $zipper null

Method Details

execute() public method

public HTMLPurifier_Token[] execute ( $tokens, $config, $context )
$tokens HTMLPurifier_Token[]
$config HTMLPurifier_Config
$context HTMLPurifier_Context
throws HTMLPurifier_Exception
processToken() protected method

Processes arbitrary token values for complicated substitution patterns.

In general:

If $token is an array, it is a list of tokens to substitute for the current token. These tokens then get individually processed. If there is a leading integer in the list, that integer determines how many tokens from the stream should be removed.

If $token is a regular token, it is swapped with the current token.

If $token is false, the current token is deleted.

If $token is an integer, that number of tokens (with the first token being the current one) will be deleted.

protected void processToken ( $token, $injector = -1 )
$token HTMLPurifier_Token|array|int|bool

Token substitution value

$injector HTMLPurifier_Injector|int

Injector that performed the substitution; default is if

   this is not an injector related operation.
throws HTMLPurifier_Exception