Issue Details (XML | Word | Printable)

Key: MDL-15331
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Andreas Grabs
Reporter: Kenneth Newquist
Votes: 1
Watchers: 4
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Moodle

Feedback fails to remove slashes when editing questions in 1.9.

Created: 20/Jun/08 11:59 PM   Updated: 12/Jan/09 07:12 PM
Component/s: Feedback
Affects Version/s: 1.9, 1.9.1
Fix Version/s: 1.9.1

File Attachments: 1. Text File feedback_lib_slashes_full_patch.txt (5 kB)

Environment: Feedback (2008050108), Moodle 1.9.1 (Build: 20080515), RHEL Linux 4, PHP 5.2.0, 5.0.27

Database: MySQL
Participants: Andreas Grabs, Jerome Mouneyrac and Kenneth Newquist
Security Level: None
QA Assignee: Jerome Mouneyrac
Resolved date: 21/Jun/08
Affected Branches: MOODLE_19_STABLE
Fixed Branches: MOODLE_19_STABLE


 Description  « Hide
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;

to this:

$item->name = empty($item->name) ? '' : stripslashes_safe($item->name);

I've attached a patch that makes this change to the affected questions.


 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Andreas Grabs added a comment - 21/Jun/08 05:04 AM
thank you!
I have fixed it.

Jerome Mouneyrac added a comment - 24/Jun/08 03:51 PM
fixed. Thanks.