]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20901 fixed input validation
authorPetr Skoda <skodak@moodle.org>
Thu, 19 Nov 2009 19:28:19 +0000 (19:28 +0000)
committerPetr Skoda <skodak@moodle.org>
Thu, 19 Nov 2009 19:28:19 +0000 (19:28 +0000)
calendar/preferences.html
calendar/preferences.php

index 8ca47f1beaf03926a9f00a01f803654a89b4d0a5..646f776f0753440f755a6d4cae126191e2fa0956 100644 (file)
@@ -83,6 +83,7 @@
 
 <tr>
     <td colspan="2" style="text-align: center;">
+    <input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
     <input type="submit" value="<?php print_string("savechanges") ?>" /></td>
 </tr>
 </table>
index bd806941c7186d999fcbe1a3ab809accaefd115e..01a1c2b23ec70f08658d1320e89816a3ebcb1345 100644 (file)
@@ -21,7 +21,7 @@ calendar_session_vars();
 
 /// If data submitted, then process and store.
 
-if ($form = data_submitted()) {
+if ($form = data_submitted() and confirm_sesskey()) {
     foreach ($form as $preference => $value) {
         switch ($preference) {
             case 'timeformat':