[Fusionforge-commits] r8810 - trunk/gforge/common/include

Roland Mas lolando at libremir.placard.fr.eu.org
Thu Feb 11 14:27:07 CET 2010


Author: lolando
Date: 2010-02-11 14:27:07 +0100 (Thu, 11 Feb 2010)
New Revision: 8810

Modified:
   trunk/gforge/common/include/utils.php
Log:
Properly initialize output buffers to fix a PHP notice

Modified: trunk/gforge/common/include/utils.php
===================================================================
--- trunk/gforge/common/include/utils.php	2010-02-11 10:35:50 UTC (rev 8809)
+++ trunk/gforge/common/include/utils.php	2010-02-11 13:27:07 UTC (rev 8810)
@@ -935,15 +935,17 @@
         return false;
     }
     
+    ob_start () ;
     while (!feof($handle)) {
-        $buffer = fread($handle, $chunksize);
-        echo $buffer;
-	ob_flush() ;
-	flush () ;
-        if ($returnBytes) {
-            $byteCounter += strlen($buffer);
-		}
+	    $buffer = fread($handle, $chunksize);
+	    echo $buffer;
+	    ob_flush() ;
+	    flush () ;
+	    if ($returnBytes) {
+		    $byteCounter += strlen($buffer);
+	    }
     }
+    ob_end_flush () ;
     $status = fclose($handle);
     if ($returnBytes && $status) {
         return $byteCounter; // return num. bytes delivered like readfile() does.




More information about the Fusionforge-commits mailing list