mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
I hope final fix for warnings when using error() after print_header() with buffering on, solution was to flush all buffers and reenable SID rewrite when needed; merged from MOODLE_16_STABLE
This commit is contained in:
parent
38316f63a5
commit
cc50d6664f
@ -1,4 +1,4 @@
|
||||
<?php
|
||||
<?php // $Id$
|
||||
/**
|
||||
* Enable cookieless sessions by including $CFG->usesid=true;
|
||||
* in config.php.
|
||||
@ -116,7 +116,7 @@ function sid_start_ob(){
|
||||
}
|
||||
}
|
||||
}
|
||||
ini_set("session.use_trans_sid", "true"); // try and turn on trans_sid
|
||||
@ini_set("session.use_trans_sid", "true"); // try and turn on trans_sid
|
||||
if (ini_get("session.use_trans_sid")!=0 ){
|
||||
// use trans sid as its available
|
||||
ini_set("url_rewriter.tags", "a=href,area=href,script=src,link=href,"
|
||||
|
@ -4029,6 +4029,12 @@ function print_scale_menu_helpbutton($courseid, $scale) {
|
||||
function error ($message, $link='') {
|
||||
global $CFG, $SESSION;
|
||||
|
||||
// flush all buffers so that we know if headers were already sent
|
||||
while (@ob_end_flush());
|
||||
// reenable SID rewrite if needed
|
||||
if (!empty($CFG->usesid) and empty($_COOKIE['MoodleSession'.$CFG->sessioncookie])) {
|
||||
sid_start_ob();
|
||||
}
|
||||
if (!headers_sent()) {
|
||||
//header not yet printed
|
||||
@header('HTTP/1.0 404 Not Found');
|
||||
|
Loading…
x
Reference in New Issue
Block a user