Browse Source

correctif buffer clean lrosque pas de buffer

idleman 4 years ago
parent
commit
29b5e8c54a
1 changed files with 2 additions and 2 deletions
  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');