Explorar el Código

correctif buffer clean lrosque pas de buffer

idleman hace 5 años
padre
commit
29b5e8c54a
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      class/File.class.php

+ 2 - 2
class/File.class.php

@@ -88,7 +88,7 @@ class File{
 			$name = (get_OS() === 'WIN') ? utf8_encode(basename($path)) : basename($path);
 		}
 	
-		ob_end_clean();
+		if (ob_get_contents()) ob_end_clean();
 		header("Content-Type: ".$mime);
 		header("Content-Length: " . strlen($stream));
 		header('Expires: Sun, 01 Jan 2014 00:00:00 GMT');
@@ -102,7 +102,7 @@ class File{
 
 	public static function downloadStream($stream, $name='Sans titre', $mime='application/octet-stream'){
 
-		ob_end_clean();
+		if (ob_get_contents()) ob_end_clean();
 		header("Content-Type: ".$mime);
 		header("Content-Length: " . strlen($stream));
 		header('Expires: Sun, 01 Jan 2014 00:00:00 GMT');