Affects Version/s: 1.9, 1.9.1
Fix Version/s: 1.9.1
Environment:Feedback (2008050108), Moodle 1.9.1 (Build: 20080515), RHEL Linux 4, PHP 5.2.0, 5.0.27
When you edit a question in Feedback under Moodle 1.9, the backslashes used to escape quotes and apostrophes in the database are not being stripped out by the module. As a result, the slashes show up when you're editing the question, and are saved to the database when you save the question.
To recreate the problem:
1. Create a Feedback.
2. Add a question with a quote or apostrophe in it.
3. Save the question.
4. Edit the question. The backslash should appear.
5. Save the question. The backslash is saved to the database.
The problem is that the 1.9 version of Moodle 1.9 is not using stripslashes_safe when it's loading the question text. The problem occurs with all of the question types and can be fixed by changing this line:
$item->name = empty($item->name) ? '' : $item->name;
$item->name = empty($item->name) ? '' : stripslashes_safe($item->name);
I've attached a patch that makes this change to the affected questions.