diff --git a/lib/private/Files/View.php b/lib/private/Files/View.php index a59f735c10..8f4b5db116 100644 --- a/lib/private/Files/View.php +++ b/lib/private/Files/View.php @@ -422,7 +422,9 @@ class View { */ public function readfile($path) { $this->assertPathLength($path); - @ob_end_clean(); + if (ob_get_level()) { + ob_end_clean(); + } $handle = $this->fopen($path, 'rb'); if ($handle) { $chunkSize = 524288; // 512 kB chunks @@ -446,7 +448,9 @@ class View { */ public function readfilePart($path, $from, $to) { $this->assertPathLength($path); - @ob_end_clean(); + if (ob_get_level()) { + ob_end_clean(); + } $handle = $this->fopen($path, 'rb'); if ($handle) { $chunkSize = 524288; // 512 kB chunks