MDL-24276 improved coding style
authorPetr Skoda <skodak@moodle.org>
Sun, 19 Sep 2010 18:49:31 +0000 (18:49 +0000)
committerPetr Skoda <skodak@moodle.org>
Sun, 19 Sep 2010 18:49:31 +0000 (18:49 +0000)
admin/cron.php
admin/health.php

index 091d5b7..eed68d3 100644 (file)
@@ -75,7 +75,10 @@ if (check_browser_version('MSIE')) {
 }
 
 // no more headers and buffers
-while(@ob_end_flush());
+@ob_implicit_flush(true);
+while(ob_get_level()) {
+    ob_end_clean();
+}
 
 // execute the cron
 cron_run();
index d6a22e2..3857926 100644 (file)
@@ -5,11 +5,9 @@
 
     // extra whitespace test - intentionally breaks cookieless mode
     $extraws = '';
-    while (true) {
+    while (ob_get_level()) {
         $extraws .= ob_get_contents();
-        if (!@ob_end_clean()) {
-            break;
-        }
+        ob_end_clean();
     }
 
     require_once($CFG->libdir.'/adminlib.php');