MDL-24277 fixed hidden error preventing proper redirects during install, yay!
authorPetr Skoda <skodak@moodle.org>
Sat, 18 Sep 2010 23:20:01 +0000 (23:20 +0000)
committerPetr Skoda <skodak@moodle.org>
Sat, 18 Sep 2010 23:20:01 +0000 (23:20 +0000)
admin/index.php
lib/weblib.php

index aa95edb..b586bad 100644 (file)
@@ -40,7 +40,9 @@ if (version_compare(phpversion(), '5.2.0') < 0) {
 
 // try to flush everything all the time
 @ob_implicit_flush(true);
-while(@ob_end_clean()); // ob_end_flush prevents sending of headers
+while(ob_get_level()) {
+    ob_end_clean(); // ob_end_flush prevents sending of headers
+}
 
 require('../config.php');
 require_once($CFG->libdir.'/adminlib.php');    // various admin-only functions
index eb16244..2656885 100644 (file)
@@ -2522,11 +2522,11 @@ function redirect($url, $message='', $delay=-1) {
 
     if (function_exists('error_get_last')) {
         $lasterror = error_get_last();
+        //NOTE: problem here is that this contains error even if error hidden with @do();
     }
     $debugdisableredirect = defined('DEBUGGING_PRINTED') ||
             (!empty($CFG->debugdisplay) && !empty($lasterror) && ($lasterror['type'] & DEBUG_DEVELOPER));
 
-    $usingmsg = false;
     if (!empty($message)) {
         if ($delay === -1 || !is_numeric($delay)) {
             $delay = 3;