Resolution: Not a bug
Affects Version/s: 2.4
Fix Version/s: None
Sorry about the title I couldn't imagine how to frame this in a single sentence.
I noticed a bug this morning while replying to posts on Moodle.org forums.
With Eloy's help we tracked it down to clean_text + html_purifier which is stripping invalid tags and trying to fix HTML => XHTML.
This in conjunction with the Geshi filter in particular is leading to a mess.
To quickly see what is going on:
- enable the geshi filter on your site.
- save the following a test.php and browse to it.
Whats of concern is that if you look at the third and final block you will see that:
Has been converted to:
What's happened is that htmlpurifier has attempted to correct the <div> tag within the string in an effort to fix the HTML.
If you have it user <diva> instead it gets stripped out entirely because diva is not a valid XHTML tag.
I hit this particular issue this morning while trying to share a code snippet.