diff options
author | Bharat Mediratta <bharat@menalto.com> | 2013-01-22 17:57:58 -0800 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2013-01-22 17:57:58 -0800 |
commit | e8302ffce5a167608595d798fc2ff692f7f1eed4 (patch) | |
tree | 5b3c3688a7bdf9236bec3f5567a0594287ac539e /modules/gallery/controllers/file_proxy.php | |
parent | 49f6ce2d94194220213edb108e4ac372acd2eabb (diff) | |
parent | 8436e16b2f2fe398be22e59110a907e7554cac90 (diff) |
Merge pull request #98 from shadlaws/fix_1954
#1954 - Skip buffer calls for unit tests of file_proxy and data_rest.
Diffstat (limited to 'modules/gallery/controllers/file_proxy.php')
-rw-r--r-- | modules/gallery/controllers/file_proxy.php | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php index f29cdf98..a9e98ce1 100644 --- a/modules/gallery/controllers/file_proxy.php +++ b/modules/gallery/controllers/file_proxy.php @@ -147,22 +147,21 @@ class File_Proxy_Controller extends Controller { header("Content-Type: $item->mime_type"); } - // 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()) { - 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; - } - } - if (TEST_MODE) { return $file; } else { + // 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()) { + 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); } } |