summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/file_proxy.php
diff options
context:
space:
mode:
authorNathan Kinkade <nath@nkinka.de>2012-05-12 13:06:18 +0000
committerNathan Kinkade <nath@nkinka.de>2012-05-12 13:06:18 +0000
commitf5098f54b8279f468d94747b1156e15ea05d6d25 (patch)
tree2ecfb6663887ffbc72de8f231864b6c78bd62640 /modules/gallery/controllers/file_proxy.php
parenta13fd7f373f3718037a2ce90a3cb408f24856602 (diff)
parentd1390bd87db1a7e59bbd72f5991fbbc6374c98b4 (diff)
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/controllers/file_proxy.php')
-rw-r--r--modules/gallery/controllers/file_proxy.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 5c958a8d..36c6bc2a 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -122,7 +122,15 @@ class File_Proxy_Controller extends Controller {
} else {
header("Content-Type: $item->mime_type");
}
- Kohana::close_buffers(false);
+
+ // Don't use Kohana::close_buffers(false) here because that only closes all the buffers
+ // that Kohana started. We want to close *all* buffers at this point because otherwise we're
+ // going to buffer up whatever file we're proxying (and it may be very large). This may
+ // affect embedding or systems with PHP's output_buffering enabled.
+ while (ob_get_level()) {
+ ob_end_clean();
+ }
+
readfile($file);
}
}