summaryrefslogtreecommitdiff
path: root/includes/file.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/file.inc')
-rw-r--r--includes/file.inc4
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/file.inc b/includes/file.inc
index 1c7c30cf2..ac8549cfd 100644
--- a/includes/file.inc
+++ b/includes/file.inc
@@ -1218,7 +1218,9 @@ function file_set_status($file, $status = FILE_STATUS_PERMANENT) {
* An array of HTTP headers to send along with file.
*/
function file_transfer($source, $headers) {
- ob_end_clean();
+ if (ob_get_level()) {
+ ob_end_clean();
+ }
foreach ($headers as $header) {
// To prevent HTTP header injection, we delete new lines that are