0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 08:21:52 +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 $needed = array('span');
private $deleteElement = false;
public function handleElement(&$token)
{
if (isset($token->_InjectorTest_EndRewindInjector_delete)) {
if ($this->deleteElement) {
$token = false;
$this->deleteElement = false;
}
}
public function handleText(&$token)
@ -23,7 +26,7 @@ class HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector extends HTMLPurifie
$prev->name == 'span'
) {
$token = false;
$prev->_InjectorTest_EndRewindInjector_delete = true;
$this->deleteElement = true;
$this->rewindOffset(1);
}
}