Свойство | Type | Description | |
---|---|---|---|
$name | Advisory name of injector, this is for friendly error messages. | ||
$needed | Array of elements and attributes this injector creates and therefore need to be allowed by the definition. Takes form of array('element' => array('attr', 'attr2'), 'element2') |
Свойство | Type | Description | |
---|---|---|---|
$currentNesting | Reference to CurrentNesting variable in Context. This is an array list of tokens that we are currently "inside" | ||
$currentToken | Reference to current token. | ||
$htmlDefinition | |||
$inputZipper | Reference to InputZipper variable in Context. | ||
$rewindOffset | Number of elements to rewind backwards (relative). |
Méthode | Description | |
---|---|---|
allowsElement ( string $name ) : boolean | Tests if the context node allows a certain element | |
checkNeeded ( HTMLPurifier_Config $config ) : boolean | string | This function checks if the HTML environment will work with the Injector: if p tags are not allowed, the Auto-Paragraphing injector should not be enabled. | |
getRewindOffset ( ) : boolean | integer | Retrieves rewind offset, and then unsets it. | |
handleElement ( &$token ) | Handler that is called when a start or empty token is processed | |
handleEnd ( &$token ) | Handler that is called when an end token is processed | |
handleText ( &$token ) | Handler that is called when a text token is processed | |
notifyEnd ( HTMLPurifier_Token $token ) | Notifier that is called when an end token is processed | |
prepare ( HTMLPurifier_Config $config, HTMLPurifier_Context $context ) : boolean | string | Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. This function also checks if the HTML environment will work with the Injector (see checkNeeded()). | |
rewindOffset ( boolean | integer $offset ) | Rewind to a spot to re-perform processing. This is useful if you deleted a node, and now need to see if this change affected any earlier nodes. Rewinding does not affect other injectors, and can result in infinite loops if not used carefully. |
Méthode | Description | |
---|---|---|
backward ( integer &$i, HTMLPurifier_Token &$current ) : boolean | Iterator function, starts with the previous token and continues until you reach the beginning of input tokens. | |
forward ( integer &$i, HTMLPurifier_Token &$current ) : boolean | Iterator function, which starts with the next token and continues until you reach the end of the input tokens. | |
forwardUntilEndToken ( integer &$i, HTMLPurifier_Token &$current, integer &$nesting ) : boolean | Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and stops when we hit the end tag for the node $this->inputIndex starts in. |
public allowsElement ( string $name ) : boolean | ||
$name | string | Name of element to test for |
Résultat | boolean | True if element is allowed, false if it is not |
public checkNeeded ( HTMLPurifier_Config $config ) : boolean | string | ||
$config | HTMLPurifier_Config | |
Résultat | boolean | string | Boolean false if success, string of missing needed element/attribute if failure |
protected forwardUntilEndToken ( integer &$i, HTMLPurifier_Token &$current, integer &$nesting ) : boolean | ||
$i | integer | Current integer index variable for inputTokens |
$current | HTMLPurifier_Token | Current token variable. Do NOT use $token, as that variable is also a reference |
$nesting | integer | |
Résultat | boolean |
public getRewindOffset ( ) : boolean | integer | ||
Résultat | boolean | integer |
public handleElement ( &$token ) |
public handleEnd ( &$token ) |
public handleText ( &$token ) |
public notifyEnd ( HTMLPurifier_Token $token ) | ||
$token | HTMLPurifier_Token | Current token variable. |
public rewindOffset ( boolean | integer $offset ) | ||
$offset | boolean | integer |
protected $currentNesting |
protected $inputZipper |
public $name |
public $needed |