MDL-20901 fixed input validation

This commit is contained in:
Petr Skoda
2009-11-21 22:22:31 +00:00
parent c64e6552f7
commit 1e7e0e1df6
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -229,7 +229,7 @@
$vtitle = get_string("show");
$vicon = "show.gif";
}
$vicon = "<a title=\"" . $vtitle . "\" href=\"$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&amp;mode=visible\"><img class=\"iconsmall\" src=\"../pix/t/" . $vicon . "\" alt=\"$vtitle\" /></a>";
$vicon = "<a title=\"" . $vtitle . "\" href=\"$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&amp;mode=visible&amp;sesskey=".sesskey()."\"><img class=\"iconsmall\" src=\"../pix/t/" . $vicon . "\" alt=\"$vtitle\" /></a>";
echo '<td align="center">' . $eicon . '&nbsp;&nbsp;' . $vicon . '</td>';
echo '</tr>';
+3 -2
View File
@@ -20,7 +20,7 @@
}
$form = data_submitted();
if ( $mode == 'visible' ) {
if ( $mode == 'visible' and confirm_sesskey()) {
if ( $displayformat ) {
if ( $displayformat->visible ) {
$displayformat->visible = 0;
@@ -31,7 +31,7 @@
}
redirect("../../$CFG->admin/module.php?sesskey=$USER->sesskey&module=glossary#formats");
die;
} elseif ( $mode == 'edit' and $form) {
} elseif ( $mode == 'edit' and $form and confirm_sesskey()) {
$displayformat->popupformatname = $form->popupformatname;
$displayformat->showgroup = $form->showgroup;
@@ -257,6 +257,7 @@
<input type="submit" value="<?php print_string("savechanges") ?>" /></td>
</tr>
<input type="hidden" name="id" value="<?php p($id) ?>" />
<input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
<input type="hidden" name="mode" value="edit" />
<?php