Following an embarassing bug that has been around since Moodle 2.1, and which no amout of testing has found until some poor user hit it, I wanted to pass on the following tip. When testing, and when you are inputting some text (e.g. a forum post, or answering an essay or shortanswer question, try to include all the tricky things that might cause Moodle to break, for example:
< > & < > & ' " \ \' \" \\ 日本語 % %% $@NULL@$ @@TEST@@
Some things that are there:
- Characters that have special meaning in HTML.
- The escaped equivalents of those.
- Single and double quote characters, and backslashes.
- Back-slash escaped versionso of those.
- Unicode characters outside the usual ASCII range. (That is Japan in Japanese.)
- Various other characters that occasionally get used with special meantings.
Hopefully automated testing will start to do this too. See MDL-37858.