HTML Formatter Exploit

Just as an example. The code used is
Looking through the HTML Formatter's code, I noticed it didn't replace a lot of the possible events one could hide javascript in. I'd recommend replacing all on* attributes in each tag with html entities, or just removing them all together.
<img src="blabla.png" onerror="alert('Hello There');" width=0 height=0>
Looking through the HTML Formatter's code, I noticed it didn't replace a lot of the possible events one could hide javascript in. I'd recommend replacing all on* attributes in each tag with html entities, or just removing them all together.

0
This discussion has been closed.
Comments
$String = preg_replace("#<(.*) on(.*)=(.*)>#si", "<\\1 on\\2=\\3>", $String);
$String = preg_replace(array("<(.*?)on(.*?)>", "<(.*?)On(.*?)>"), array("\\1on\\2", "\\1Ln\\2"), $String);
Whoops, that replaces all 'o's now. Hmm... this is getting annoying.
Click Me
So that's three bugs discovered so far, hopefully all fixed in this revision.
no wonder it didn't work
*gives mark donuts