Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.9.8
-
Fix Version/s: None
-
Component/s: Module: Journal
-
Labels:
-
URL:http://<moodle url>/mod/journal/report.php
-
Affected Branches:MOODLE_19_STABLE
Description
Journal Feedback Report page http://<moodle url>/mod/journal/report.php correctly saves entries with apostrophes & double quotes slash-escaped, but does not remove the slashes before dispalying when showing user entries.
E.g. can't shows up as can\'t
One possible fix is to add stripslashes to "p($entry->entrycomment);" like this:
function journal_print_user_entry($course, $user, $entry, $teachers, $grades) {
...
...
if ($entry->timemarked) {
echo " <font size=\"1\">".userdate($entry->timemarked)."</font>";
}
echo "<br /><textarea name=\"c$entry->id\" rows=\"12\" cols=\"60\" wrap=\"virtual\">";
p(stripslashes($entry->entrycomment));
echo "</textarea><br />";
echo "</td></tr>";
}
echo "</table><br clear=\"all\" />\n";
}
Attachments
Issue Links
| This issue is duplicated by: | ||||
| MDL-14845 | Journal feedback inserts backslashes before apostrophe and quote marks |
|
|
|
I would say that this "should" fix the issue, but it doesn't completely. If you don't update all of the feedback at once, then the next time you go to edit it, the slashes get slashed, meaning for each subsequent save, more slashes appear in the feedback area. Seems to me this is because addslashes is getting done every time and should check to see if it's necessary before adding more.
Anyone disagree? Mark, I assume it's just you and me on this one.
Thanks.