summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/file_proxy.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2012-05-08 18:23:09 -0700
committerBharat Mediratta <bharat@menalto.com>2012-05-08 18:23:33 -0700
commitb512734b9d202807eb7fbc2830f37a1c867c790a (patch)
tree8d4ca6f31920e6b86271e683813041c57d593779 /modules/gallery/controllers/file_proxy.php
parent7c868ee71e728c78080ee37aa690510387feea8c (diff)
Close all buffers, not just the ones that Kohana opened. Fixes #1821,
thanks to pvalsecc.
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);
}
}