diff options
author | Bharat Mediratta <bharat@menalto.com> | 2012-06-04 19:54:01 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2012-06-04 19:54:01 -0700 |
commit | 3fbe07078fa57abe82b9584e11075a83ce15265a (patch) | |
tree | acf5f10d474779a4f56a08c71985b67039157386 /modules/gallery/controllers | |
parent | 4c98b218316df00c8bf3eeb28a8324ec64348bff (diff) |
Second attempt to fix #1821 - first attempt caused an infinite loop in some cases
when zlib.output_compression is enabled.
Diffstat (limited to 'modules/gallery/controllers')
-rw-r--r-- | modules/gallery/controllers/file_proxy.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php index 36c6bc2a..47def436 100644 --- a/modules/gallery/controllers/file_proxy.php +++ b/modules/gallery/controllers/file_proxy.php @@ -128,7 +128,12 @@ class File_Proxy_Controller extends Controller { // 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(); + Kohana_Log::add("error","".print_r(ob_get_level(),1)); + if (!@ob_end_clean()) { + // ob_end_clean() can return false if the buffer can't be removed for some reason + // (zlib output compression buffers sometimes cause problems). + break; + } } readfile($file); |