MDL-35638 backup: Do not print headers during redirects

This commit is contained in:
Ankit Agarwal
2014-11-17 10:38:50 +13:00
committed by Sam Hemelryk
parent 583cf99ebd
commit 6748b5ee5c
+5 -1
View File
@@ -6,6 +6,7 @@ require_once($CFG->dirroot . '/backup/util/includes/restore_includes.php');
$contextid = required_param('contextid', PARAM_INT);
$stage = optional_param('stage', restore_ui::STAGE_CONFIRM, PARAM_INT);
$cancel = optional_param('cancel', '', PARAM_ALPHA);
list($context, $course, $cm) = get_context_info_array($contextid);
@@ -30,7 +31,10 @@ $PAGE->set_title($courseshortname . ': ' . get_string('restore'));
$PAGE->set_heading($coursefullname);
$renderer = $PAGE->get_renderer('core','backup');
echo $OUTPUT->header();
if (empty($cancel)) {
// Do not print the header if user cancelled the process, as we are going to redirect the user.
echo $OUTPUT->header();
}
// Prepare a progress bar which can display optionally during long-running
// operations while setting up the UI.