Rerun
[fa-stable.git] / includes / errors.inc
index a9b68898498fb0e4f9854e678ad155b86a3bfa57..f2cfe1c0fc1b113c6fee2e58706969c0b2484b27 100644 (file)
@@ -84,9 +84,9 @@ function error_box() {
     global $before_box;
     
     echo "<div id='msgbox'>";
-       $before_box = ob_get_clean(); // save html content before error box 
+
 // Necessary restart instead of get_contents/clean calls due to a bug in php 4.3.2
-       register_shutdown_function('end_flush');
+       $before_box = ob_get_clean(); // save html content before error box 
     ob_start('output_html');
     echo "</div>";
 }
@@ -94,7 +94,12 @@ function error_box() {
        Helper to avoid sparse log notices.
 */
 function end_flush () {
-               if (ob_get_level()) ob_end_flush();
+       global $Ajax;
+
+       if (isset($Ajax))
+               $Ajax->run();
+       // flush all output buffers (works also with exit inside any div levels)
+       while(ob_get_level()) ob_end_flush();
 }
 
 function display_db_error($msg, $sql_statement=null, $exit=true)