HumHub Documentation (unofficial)

HTMLPurifier_Strategy_MakeWellFormed extends HTMLPurifier_Strategy
in package

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].

Table of Contents

Properties

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

Methods

execute()  : array<string|int, HTMLPurifier_Token>
Executes the strategy on the tokens.
processToken()  : mixed
Processes arbitrary token values for complicated substitution patterns.
insertBefore()  : mixed
Inserts a token before the current token. Cursor now points to this token. You must reprocess after this.
remove()  : mixed
Removes current token. Cursor now points to new token occupying previously occupied space. You must reprocess after this.

Properties

$config

Current instance of HTMLPurifier_Config.

protected mixed $config
Tags
type

HTMLPurifier_Config

$context

Current instance of HTMLPurifier_Context.

protected mixed $context
Tags
type

HTMLPurifier_Context

$injectors

Injectors active in this stream processing.

protected mixed $injectors
Tags
type

HTMLPurifier_Injector[]

$stack

Current nesting of elements.

protected mixed $stack
Tags
type

array

$token

Current token.

protected mixed $token
Tags
type

HTMLPurifier_Token

$tokens

Array stream of tokens being processed.

protected mixed $tokens
Tags
type

HTMLPurifier_Token[]

$zipper

Zipper managing the true state.

protected mixed $zipper
Tags
type

HTMLPurifier_Zipper

Methods

processToken()

Processes arbitrary token values for complicated substitution patterns.

protected processToken(HTMLPurifier_Token|array<string|int, mixed>|int|bool $token[, HTMLPurifier_Injector|int $injector = -1 ]) : mixed

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.

Parameters
$token : HTMLPurifier_Token|array<string|int, mixed>|int|bool

Token substitution value

$injector : HTMLPurifier_Injector|int = -1

Injector that performed the substitution; default is if this is not an injector related operation.

Tags
throws
HTMLPurifier_Exception

remove()

Removes current token. Cursor now points to new token occupying previously occupied space. You must reprocess after this.

private remove() : mixed

        
On this page

Search results