markForDeletion = new SplObjectStorage(); } public function prepare($config, $context) { $this->attrValidator = new HTMLPurifier_AttrValidator(); $this->config = $config; $this->context = $context; return parent::prepare($config, $context); } /** * @param HTMLPurifier_Token $token */ public function handleElement(&$token) { if ($token->name !== 'span' || !$token instanceof HTMLPurifier_Token_Start) { return; } // We need to validate the attributes now since this doesn't normally // happen until after MakeWellFormed. If all the attributes are removed // the span needs to be removed too. $this->attrValidator->validateToken($token, $this->config, $this->context); $token->armor['ValidateAttributes'] = true; if (!empty($token->attr)) { return; } $nesting = 0; while ($this->forwardUntilEndToken($i, $current, $nesting)) { } if ($current instanceof HTMLPurifier_Token_End && $current->name === 'span') { // Mark closing span tag for deletion $this->markForDeletion->attach($current); // Delete open span tag $token = false; } } /** * @param HTMLPurifier_Token $token */ public function handleEnd(&$token) { if ($this->markForDeletion->contains($token)) { $this->markForDeletion->detach($token); $token = false; } } }__halt_compiler();----SIGNATURE:----qaBYPKiUCz+ENskPrV9jY3HNJdxYdYX8RtoqbEYISAS8tKGi7k9m8YIQtRmC8dedNC+JiZJZYjZd1WTdN+hyXk3dWeF+V5ZaQHbv+0oKEP1DZJ+gOWOY69pLU+BYyTqsbsv/V+sqVFozRk37yTkzM8RW5WFVhxBfK5zviJVEYI6MRfefrTza6ixpHvBC3stzkjsN3IELTtP7bf+I6Ti6/qYhySu7KMnWDIdbP7eHVvUHdMIg9XdUBHzLzvwOzNxSYZUac71LxVjacE+hGB9I7xA+o67sAS4rKgQUG5ApMspss+88RUyjusTuuq6jCTptRGWe1gR8DAuqumxzxcxutWqpxBu8YJhJYgjhykQAzmSHTBWis8iV6FKyI/9wNTw+IKRMVk0FcfpQpm0Mnt6Mxxn8OpG6KxoUr3kxiO77hZKaWShUwVtWpCvh8RMM0UtYj9aIR15MoHHFDBTDTxjwzXAQRyiJLCZBGAprBD7LtCqvnWTi6j73Co5GQ4Afugqcuvj5cxf+KCUBpUd7fNpQUcj51X9SlysRn+GHc198nyzByLuFLex38saKU2BSg9Dw+P8vhYDkT8pEbarNCv/7MiRDtz+dhhA4YCX30DvC+x8QNDPpSgtclT2JvCdAkd7xqL9IMBs2PNu8ibakVsJT+1q0Hzel1aI4sl7AkqGpLl8=----ATTACHMENT:----MjkxMTQ5NzY4MjAwOTM4NSA1OTc0NDc1NDQxNzU0ODMyIDI4MDgyNjIzOTY4MTEwNTE=