mirror of
https://github.com/catalyst/moodle-auth_outage.git
synced 2026-09-07 00:06:01 +02:00
Set outage metadata headers before echoing injected warning-bar code to avoid headers-already-sent
This commit is contained in:
@@ -107,10 +107,8 @@ class infopage {
|
||||
$PAGE->set_heading($this->outage->get_title());
|
||||
$PAGE->set_url(new moodle_url('/auth/outage/info.php'));
|
||||
|
||||
// No hooks injecting into this page, do it manually.
|
||||
echo outagelib::get_inject_code();
|
||||
|
||||
// Inject metadata into the header before output.
|
||||
// Inject metadata into the header before any output starts, otherwise header() will
|
||||
// fail once outagelib::get_inject_code() below has echoed anything.
|
||||
if (!empty($this->outage->metadata)) {
|
||||
$safemeta = str_replace(["\r", "\n"], '', $this->outage->metadata);
|
||||
header('X-Outage-Metadata: ' . $safemeta);
|
||||
@@ -118,6 +116,9 @@ class infopage {
|
||||
header('X-Outage-EndTime: ' . $this->outage->stoptime);
|
||||
}
|
||||
|
||||
// No hooks injecting into this page, do it manually.
|
||||
echo outagelib::get_inject_code();
|
||||
|
||||
echo $OUTPUT->header();
|
||||
$viewbag = [
|
||||
'admin' => is_siteadmin(),
|
||||
|
||||
Reference in New Issue
Block a user