More refactoring to MakeWellFormed and Injectors; they work better than ever now!
commitcd4500457ecdebc4c9178484065189ac5e4dc3d9
authorEdward Z. Yang <edwardzyang@thewritingpot.com>
Wed, 1 Oct 2008 07:14:28 +0000 (1 03:14 -0400)
committerEdward Z. Yang <edwardzyang@thewritingpot.com>
Wed, 1 Oct 2008 07:14:28 +0000 (1 03:14 -0400)
tree0b3b0ea7caf14dfcdbfee2af931734d65c7f8cc2
parentfa413e96ac4bf2c4efb0303c0aafcfa3fc39413d
More refactoring to MakeWellFormed and Injectors; they work better than ever now!

Major paradigm shift in this commit is bailing ship on the "skip" integers, which
were extremely buggy and error prone, and simply mark tokens as processed or
not processed by injectors. Other notable changes:

- Removed ad hoc decrements to inputIndex in favor of $reprocess flag variable
- Moved rewind outside of processToken()
- Make rewind properly ignore all other injectors
- Cleanup end of document code
- Reconfigure injector loops to account for skips and rewinds
- Punt the empty to start/end transformation
- Completely rewrite processToken to be array based
- Added skip and rewind member variables to tokens
- Fixed a longstanding bug with remove empty!

Signed-off-by: Edward Z. Yang <edwardzyang@thewritingpot.com>
library/HTMLPurifier/Injector.php
library/HTMLPurifier/Strategy/MakeWellFormed.php
library/HTMLPurifier/Token.php
tests/HTMLPurifier/Strategy/MakeWellFormed_InjectorTest.php