MDL-20901 fixed input validation

This commit is contained in:
Petr Skoda
2009-11-20 08:51:20 +00:00
parent 135765992f
commit df09d649ab
3 changed files with 4 additions and 2 deletions
+2 -2
View File
@@ -118,14 +118,14 @@ function glossary_comment_delete() {
error('You can\'t delete comments in this glossary!');
}
if (data_submitted() and $confirm) {
if (data_submitted() and $confirm and confirm_sesskey()) {
delete_records('glossary_comments','id', $cid);
add_to_log($course->id, 'glossary', 'delete comment', "comments.php?id=$cm->id&eid=$entry->id", "$comment->id",$cm->id);
redirect("comments.php?id=$cm->id&eid=$entry->id");
} else {
$linkyes = 'comment.php';
$optionsyes = array('action'=>'delete', 'cid'=>$cid, 'confirm'=>1);
$optionsyes = array('action'=>'delete', 'cid'=>$cid, 'confirm'=>1, 'sesskey'=>sesskey());
$linkno = 'comments.php';
$optionsno = array('id'=>$cm->id, 'eid'=>$entry->id);
$strdeletewarning = get_string('areyousuredeletecomment','glossary');
+1
View File
@@ -44,6 +44,7 @@
</table>
<div>
<input type="hidden" name="id" value="<?php p($id) ?>" />
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
<input type="hidden" name="step" value="1" />
</div>
</form>
+1
View File
@@ -63,6 +63,7 @@
exit;
}
require_sesskey();
$form = data_submitted();
$file = $_FILES["file"];