Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-20901 fixed input validationand removed annoying redirect which m…

…ust not be clicked during course import
  • Loading branch information...
commit 4d93b2059f881095a431653f5329f75a558f07d4 1 parent a8adf25
Petr Skoda skodak authored
2  backup/restore.php
@@ -154,6 +154,7 @@
154 154 if (!empty($SESSION->restore->importing)) {
155 155 // set up all the config stuff and skip asking the user about it.
156 156 restore_setup_for_check($SESSION->restore,$backup_unique_code);
  157 + require_sesskey();
157 158 include_once("restore_execute.html");
158 159 } else {
159 160 include_once("restore_form.html");
@@ -169,6 +170,7 @@
169 170 }
170 171 //Unset this for the future
171 172 unset($SESSION->cancontinue);
  173 + require_sesskey();
172 174 include_once("restore_execute.html");
173 175 }
174 176 print_simple_box_end();
1  backup/restore_check.html
@@ -355,6 +355,7 @@
355 355 $hidden["launch"] = "execute";
356 356 $hidden["file"] = $file;
357 357 $hidden["id"] = $id;
  358 + $hidden["sesskey"] = sesskey();
358 359 print_string('longtimewarning','admin');
359 360
360 361
7 backup/restorelib.php
@@ -7804,10 +7804,9 @@ function restore_precheck($id,$file,&$errorstr,$noredirect=false) {
7804 7804 }
7805 7805 else {
7806 7806 if (empty($noredirect)) {
7807   - // in 2.0 we must not print "Continue" redirect link here, because ppl click on it and the execution gets interrupted on next page!!!
7808   - // imo RESTORE_SILENTLY is an ugly hack :-P
7809   - $sillystr = get_string('donotclickcontinue');
7810   - redirect($CFG->wwwroot.'/backup/restore.php?backup_unique_code='.$backup_unique_code.'&launch=form&file='.$file.'&id='.$id, $sillystr, 0);
  7807 + print_continue($CFG->wwwroot.'/backup/restore.php?backup_unique_code='.$backup_unique_code.'&launch=form&file='.$file.'&id='.$id.'&sesskey='.sesskey());
  7808 + print_footer();
  7809 + die;
7811 7810
7812 7811 } else {
7813 7812 return $backup_unique_code;

0 comments on commit 4d93b20

Please sign in to comment.
Something went wrong with that request. Please try again.