]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-20901 fixed input validation
authorPetr Skoda <skodak@moodle.org>
Thu, 19 Nov 2009 18:11:14 +0000 (18:11 +0000)
committerPetr Skoda <skodak@moodle.org>
Thu, 19 Nov 2009 18:11:14 +0000 (18:11 +0000)
backup/backup.php
backup/backup_check.html
backup/backup_form.html

index 4a89ac7b91027bc15bfc8b737adee79afab6c0ac..1ee0ed3b5f33d550fdb286c4540399173559bb29 100644 (file)
     raise_memory_limit("192M");
 
     //Call the form, depending the step we are
-    if (!$launch) {
+    if (!$launch or !data_submitted() or !confirm_sesskey()) {
         // if we're at the start, clear the cache of prefs
         if (isset($SESSION->backupprefs[$course->id])) {
             unset($SESSION->backupprefs[$course->id]);
index 368a20b18c47ca15cd4653f55cd0df665483b571..853a099280a0d810fc63c8e70f450f0f4c04f88b 100644 (file)
@@ -50,6 +50,7 @@
 <form id="form" method="post" action="backup.php">
 <table cellpadding="5" style="text-align:center;margin-left:auto;margin-right:auto">
 <?php
+    echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
 
     if (empty($to)) {
         //Now print the Backup Name tr
index 20c0a388253a0ca92d263e83960edf717a175cc7..e13e31cd989d24b7fe351c206ad1a6c400f3f317 100644 (file)
@@ -124,6 +124,8 @@ function selectItemInCheckboxByName(formId, checkName, checked ) {
 <form id="form1" method="post" action="backup.php">
 <table cellpadding="5" style="margin-left:auto;margin-right:auto;">
 <?php
+    echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
+
 /// Acummulator for hidden options and proper XHTML output
     $hidden_options = '';
     //Now, check modules and info and show posibilities