Adds important param elements to inside of object in order to make things safe.
More...
|
| prepare ($config, $context) |
|
| handleElement (&$token) |
|
| handleEnd (&$token) |
|
| rewind ($index) |
| Rewind to a spot to re-perform processing. More...
|
|
| getRewind () |
| Retrieves rewind, and then unsets it. More...
|
|
| prepare ($config, $context) |
| Prepares the injector by giving it the config and context objects: this allows references to important variables to be made within the injector. More...
|
|
| checkNeeded ($config) |
| 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. More...
|
|
| allowsElement ($name) |
| Tests if the context node allows a certain element. More...
|
|
| handleText (&$token) |
| Handler that is called when a text token is processed. More...
|
|
| handleElement (&$token) |
| Handler that is called when a start or empty token is processed. More...
|
|
| handleEnd (&$token) |
| Handler that is called when an end token is processed. More...
|
|
| notifyEnd ($token) |
| Notifier that is called when an end token is processed. More...
|
|
|
| $name = 'SafeObject' |
|
| $needed = array('object', 'param') |
|
| $name |
| Advisory name of injector, this is for friendly error messages. More...
|
|
| $needed = array() |
| Array of elements and attributes this injector creates and therefore need to be allowed by the definition. More...
|
|
|
| forward (&$i, &$current) |
| Iterator function, which starts with the next token and continues until you reach the end of the input tokens. More...
|
|
| forwardUntilEndToken (&$i, &$current, &$nesting) |
| 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. More...
|
|
| backward (&$i, &$current) |
| Iterator function, starts with the previous token and continues until you reach the beginning of input tokens. More...
|
|
| current (&$i, &$current) |
| Initializes the iterator at the current position. More...
|
|
Adds important param elements to inside of object in order to make things safe.
Definition at line 7 of file SafeObject.php.
◆ handleElement()
HTMLPurifier_Injector_SafeObject::handleElement |
( |
& |
$token | ) |
|
Definition at line 32 of file SafeObject.php.
References $n, and $name.
33 if ($token->name ==
'object') {
34 $this->objectStack[] = $token;
35 $this->paramStack[] = array();
37 foreach ($this->addParam as
$name => $value) {
41 } elseif ($token->name ==
'param') {
42 $nest = count($this->currentNesting) - 1;
43 if ($nest >= 0 && $this->currentNesting[$nest]->name ===
'object') {
44 $i = count($this->objectStack) - 1;
45 if (!isset($token->attr[
'name'])) {
49 $n = $token->attr[
'name'];
53 if (!isset($this->objectStack[$i]->attr[
'data']) &&
54 ($token->attr[
'name'] ==
'movie' || $token->attr[
'name'] ==
'src')) {
55 $this->objectStack[$i]->attr[
'data'] = $token->attr[
'value'];
60 !isset($this->paramStack[$i][
$n]) &&
61 isset($this->addParam[$n]) &&
62 $token->attr[
'name'] === $this->addParam[$n]
65 $this->paramStack[$i][
$n] =
true;
66 } elseif (isset($this->allowedParam[$n])) {
Concrete empty token class.
◆ handleEnd()
HTMLPurifier_Injector_SafeObject::handleEnd |
( |
& |
$token | ) |
|
Definition at line 79 of file SafeObject.php.
83 if ($token->name ==
'object') {
84 array_pop($this->objectStack);
85 array_pop($this->paramStack);
◆ prepare()
HTMLPurifier_Injector_SafeObject::prepare |
( |
|
$config, |
|
|
|
$context |
|
) |
| |
Definition at line 28 of file SafeObject.php.
29 parent::prepare($config, $context);
◆ $addParam
HTMLPurifier_Injector_SafeObject::$addParam |
|
protected |
Initial value:= array(
'allowScriptAccess' => 'never',
'allowNetworking' => 'internal',
)
Definition at line 16 of file SafeObject.php.
◆ $allowedParam
HTMLPurifier_Injector_SafeObject::$allowedParam |
|
protected |
Initial value:= array(
'wmode' => true,
'movie' => true,
'flashvars' => true,
'src' => true,
'allowFullScreen' => true,
)
Definition at line 20 of file SafeObject.php.
◆ $name
HTMLPurifier_Injector_SafeObject::$name = 'SafeObject' |
◆ $needed
HTMLPurifier_Injector_SafeObject::$needed = array('object', 'param') |
◆ $objectStack
HTMLPurifier_Injector_SafeObject::$objectStack = array() |
|
protected |
◆ $paramStack
HTMLPurifier_Injector_SafeObject::$paramStack = array() |
|
protected |
The documentation for this class was generated from the following file:
- Services/Html/HtmlPurifier/library/HTMLPurifier/Injector/SafeObject.php