NOBUG fixed infinite loop when zlib compression enabled
authorPetr Skoda <skodak@moodle.org>
Fri, 5 Nov 2010 08:32:36 +0000 (08:32 +0000)
committerPetr Skoda <skodak@moodle.org>
Fri, 5 Nov 2010 08:32:36 +0000 (08:32 +0000)
lib/outputrenderers.php

index 1f38167..e24f7dd 100644 (file)
@@ -2059,7 +2059,11 @@ EOD;
             // because the buffered text would be printed before our start of page.
             // NOTE: this hack might be behave unexpectedly in case output buffering is enabled in PHP.ini
             while (ob_get_level() > 0) {
-                $obbuffer .= ob_get_clean();
+                $buff = ob_get_clean();
+                if ($buff === false) {
+                    break;
+                }
+                $obbuffer .= $buff;
             }
 
             // Header not yet printed