Jun 20 2008

Moodle 1.9: Calendar fails to strip slashes

Published by Kenneth Newquist at 9:42 am under Moodle, Web Applications and tagged: ,




Event names and body text in Calendar are not properly escaped with stripslashes. This causes slashes to appear in front of apostrophes when you edit, save and then re-edit an event that occurs over multiple dates. This bug has existed since Moodle 1.7. I’ve updated the tracker report, and attached a patch to it.

http://tracker.moodle.org/browse/MDL-10633

My initial diagnosis of the problem was wrong; I was coming off a problem with stripslashes_recursive elsewhere in Moodle and leapt to conclusions. I also didn’t read the code quite right; the bit I ‘fixed’ was actually for logging, and it was a happy accident that it happened to fix the problem in Moodle 1.8.

With Moodle 1.9 I think I’ve nailed the problem; now it’s just a question of whether we should use stripslashes or stripslashes_safe in this instance (my patches use the former, but after reading the docs for the later, stripslashes_safe is probably the way to go).

 

 

One response so far


Create a free edublog to get your own comment avatar (and more!)

One Response to “Moodle 1.9: Calendar fails to strip slashes”

  1.   Kenneth Newquiston 01 Jul 2008 at 9:02 am

    My patch was accepted and rolled into Moodle 1.9.2 and 1.8.6.

    http://tracker.moodle.org/browse/MDL-10633

Trackback URI | Comments RSS

Leave a Reply

*
To prove you're a person (not a spam script), type the security word shown in the picture.
Anti-Spam Image