99 $this->htmlDefinition =
$config->getHTMLDefinition();
107 $this->currentNesting =& $context->get(
'CurrentNesting');
108 $this->currentToken =& $context->get(
'CurrentToken');
109 $this->inputZipper =& $context->get(
'InputZipper');
122 $def =
$config->getHTMLDefinition();
123 foreach ($this->needed as $element => $attributes) {
124 if (is_int($element)) {
125 $element = $attributes;
127 if (!isset($def->info[$element])) {
130 if (!is_array($attributes)) {
133 foreach ($attributes as
$name) {
134 if (!isset($def->info[$element]->attr[$name])) {
135 return "$element.$name";
149 if (!empty($this->currentNesting)) {
150 $parent_token = array_pop($this->currentNesting);
151 $this->currentNesting[] = $parent_token;
152 $parent = $this->htmlDefinition->info[$parent_token->name];
154 $parent = $this->htmlDefinition->info_parent_def;
156 if (!isset($parent->child->elements[
$name]) || isset($parent->excludes[
$name])) {
160 for ($i = count($this->currentNesting) - 2; $i >= 0; $i--) {
161 $node = $this->currentNesting[$i];
162 $def = $this->htmlDefinition->info[$node->name];
163 if (isset($def->excludes[
$name])) {
183 $i = count($this->inputZipper->back) - 1;
190 $current = $this->inputZipper->back[$i];
210 if ($nesting === null) {
237 $i = count($this->inputZipper->front) - 1;
244 $current = $this->inputZipper->front[$i];
allowsElement($name)
Tests if the context node allows a certain element.
$htmlDefinition
HTMLPurifier_HTMLDefinition
Concrete end token class.
$inputZipper
Reference to InputZipper variable in Context.
$currentToken
Reference to current token.
Concrete start token class.
forward(&$i, &$current)
Iterator function, which starts with the next token and continues until you reach the end of the inpu...
prepare($config, $context)
Prepares the injector by giving it the config and context objects: this allows references to importan...
getRewindOffset()
Retrieves rewind offset, and then unsets it.
forwardUntilEndToken(&$i, &$current, &$nesting)
Similar to _forward, but accepts a third parameter $nesting (which should be initialized at 0) and st...
notifyEnd($token)
Notifier that is called when an end token is processed.
$name
Advisory name of injector, this is for friendly error messages.
Create styles array
The data for the language used.
checkNeeded($config)
This function checks if the HTML environment will work with the Injector: if p tags are not allowed...
Injects tokens into the document while parsing for well-formedness.
$rewindOffset
Number of elements to rewind backwards (relative).
backward(&$i, &$current)
Iterator function, starts with the previous token and continues until you reach the beginning of inpu...
handleText(&$token)
Handler that is called when a text token is processed.
handleEnd(&$token)
Handler that is called when an end token is processed.
$currentNesting
Reference to CurrentNesting variable in Context.
rewindOffset($offset)
Rewind to a spot to re-perform processing.
handleElement(&$token)
Handler that is called when a start or empty token is processed.
$needed
Array of elements and attributes this injector creates and therefore need to be allowed by the defini...