Skip to content

Commit

Permalink
Bug #6293 - Cannot regrade a question when a teacher has added a comm…
Browse files Browse the repository at this point in the history
…ent with a ' Stupid, wreched, datalib. Why can't datalib take care of addslashes, so the whole of the rest of the code can forget about it? That is how a database abstraction layer should work. I know, it is pointless to moan about it, but it has just cost me 3 hours, so I feel I have earned the right to moan.
  • Loading branch information
tjhunt committed Aug 18, 2006
1 parent f7abe85 commit 2b64c31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/questionlib.php
Expand Up @@ -715,6 +715,8 @@ function save_question_session(&$question, &$state) {
$session->newgraded = $state->id;
$session->sumpenalty = $state->sumpenalty;
$session->comment = $state->comment;
} else {
$session->comment = addslashes($session->comment);
}
update_record('question_sessions', $session);
}
Expand Down
2 changes: 1 addition & 1 deletion question/comment.html
Expand Up @@ -10,7 +10,7 @@
</td>
<td>
<?php
print_textarea($usehtmleditor, 15, 60, 630, 300, $prefix.'[comment]', $state->comment);
print_textarea($usehtmleditor, 15, 60, 630, 300, $prefix.'[comment]', stripslashes($state->comment));
?>
</td>
</tr>
Expand Down

0 comments on commit 2b64c31

Please sign in to comment.