diff options
author | Christian Vogeley <christian.vogeley@hotmail.de> | 2015-01-11 16:22:59 +0100 |
---|---|---|
committer | Christian Vogeley <christian.vogeley@hotmail.de> | 2015-01-11 16:22:59 +0100 |
commit | f0c7612bcd49d32e408e67ac1829ee891c677f7e (patch) | |
tree | d4cff4aa2d728524b631776ffffee71f42056421 /library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php | |
parent | 43f143a211c75138d09ceb89acc48ea7d5c31ca9 (diff) | |
parent | 10102ac2ac4d5b02012a9794e23656717ab05556 (diff) | |
download | volse-hubzilla-f0c7612bcd49d32e408e67ac1829ee891c677f7e.tar.gz volse-hubzilla-f0c7612bcd49d32e408e67ac1829ee891c677f7e.tar.bz2 volse-hubzilla-f0c7612bcd49d32e408e67ac1829ee891c677f7e.zip |
Merge remote-tracking branch 'upstream/master'
Conflicts:
doc/html/classRedmatrix_1_1Import_1_1Import-members.html
doc/html/classRedmatrix_1_1Import_1_1Import.js
Diffstat (limited to 'library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php')
-rw-r--r-- | library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php | 36 |
1 files changed, 30 insertions, 6 deletions
diff --git a/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php b/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php index b21313470..9ee7aa84d 100644 --- a/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php +++ b/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php @@ -5,25 +5,45 @@ */ class HTMLPurifier_Injector_RemoveSpansWithoutAttributes extends HTMLPurifier_Injector { + /** + * @type string + */ public $name = 'RemoveSpansWithoutAttributes'; + + /** + * @type array + */ public $needed = array('span'); + /** + * @type HTMLPurifier_AttrValidator + */ private $attrValidator; /** - * Used by AttrValidator + * Used by AttrValidator. + * @type HTMLPurifier_Config */ private $config; + + /** + * @type HTMLPurifier_Context + */ private $context; - public function prepare($config, $context) { + public function prepare($config, $context) + { $this->attrValidator = new HTMLPurifier_AttrValidator(); $this->config = $config; $this->context = $context; return parent::prepare($config, $context); } - public function handleElement(&$token) { + /** + * @param HTMLPurifier_Token $token + */ + public function handleElement(&$token) + { if ($token->name !== 'span' || !$token instanceof HTMLPurifier_Token_Start) { return; } @@ -39,8 +59,8 @@ class HTMLPurifier_Injector_RemoveSpansWithoutAttributes extends HTMLPurifier_In } $nesting = 0; - $spanContentTokens = array(); - while ($this->forwardUntilEndToken($i, $current, $nesting)) {} + while ($this->forwardUntilEndToken($i, $current, $nesting)) { + } if ($current instanceof HTMLPurifier_Token_End && $current->name === 'span') { // Mark closing span tag for deletion @@ -50,7 +70,11 @@ class HTMLPurifier_Injector_RemoveSpansWithoutAttributes extends HTMLPurifier_In } } - public function handleEnd(&$token) { + /** + * @param HTMLPurifier_Token $token + */ + public function handleEnd(&$token) + { if ($token->markForDeletion) { $token = false; } |