0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-10 15:48:42 +00:00

Fix creation of dynamic property (#337)

This commit is contained in:
Kieran 2022-09-10 19:03:42 +01:00 committed by GitHub
parent 36e06603a8
commit ce9cf2ec99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,10 +4,13 @@ class HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector extends HTMLPurifie
{ {
public $name = 'EndRewindInjector'; public $name = 'EndRewindInjector';
public $needed = array('span'); public $needed = array('span');
private $deleteElement = false;
public function handleElement(&$token) public function handleElement(&$token)
{ {
if (isset($token->_InjectorTest_EndRewindInjector_delete)) { if ($this->deleteElement) {
$token = false; $token = false;
$this->deleteElement = false;
} }
} }
public function handleText(&$token) public function handleText(&$token)
@ -23,7 +26,7 @@ class HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector extends HTMLPurifie
$prev->name == 'span' $prev->name == 'span'
) { ) {
$token = false; $token = false;
$prev->_InjectorTest_EndRewindInjector_delete = true; $this->deleteElement = true;
$this->rewindOffset(1); $this->rewindOffset(1);
} }
} }