Prepended constants with C_ to avoid reserved words as per https://www.php.net/manual...
[htmlpurifier/darkodev.git] / tests / HTMLPurifier / Strategy / MakeWellFormed / EndRewindInjector.php
blob0e5a8e2002c5f24f1692668906090b2d8252ff46
1 <?php
3 class HTMLPurifier_Strategy_MakeWellFormed_EndRewindInjector extends HTMLPurifier_Injector
5 public $name = 'EndRewindInjector';
6 public $needed = array('span');
7 public function handleElement(&$token)
9 if (isset($token->_InjectorTest_EndRewindInjector_delete)) {
10 $token = false;
13 public function handleText(&$token)
15 $token = false;
17 public function handleEnd(&$token)
19 $i = null;
20 if (
21 $this->backward($i, $prev) &&
22 $prev instanceof HTMLPurifier_Token_Start &&
23 $prev->name == 'span'
24 ) {
25 $token = false;
26 $prev->_InjectorTest_EndRewindInjector_delete = true;
27 $this->rewindOffset(1);
32 // vim: et sw=4 sts=4