summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/data_rest.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2013-01-22 17:57:58 -0800
committerBharat Mediratta <bharat@menalto.com>2013-01-22 17:57:58 -0800
commite8302ffce5a167608595d798fc2ff692f7f1eed4 (patch)
tree5b3c3688a7bdf9236bec3f5567a0594287ac539e /modules/gallery/helpers/data_rest.php
parent49f6ce2d94194220213edb108e4ac372acd2eabb (diff)
parent8436e16b2f2fe398be22e59110a907e7554cac90 (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/helpers/data_rest.php')
-rw-r--r--modules/gallery/helpers/data_rest.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/modules/gallery/helpers/data_rest.php b/modules/gallery/helpers/data_rest.php
index 8a3a159d..dc213510 100644
--- a/modules/gallery/helpers/data_rest.php
+++ b/modules/gallery/helpers/data_rest.php
@@ -57,13 +57,14 @@ class data_rest_Core {
} else {
header("Content-Type: $item->mime_type");
}
- Kohana::close_buffers(false);
- if (isset($p->encoding) && $p->encoding == "base64") {
- print base64_encode(file_get_contents($file));
+ if (TEST_MODE) {
+ return $file;
} else {
- if (TEST_MODE) {
- return $file;
+ Kohana::close_buffers(false);
+
+ if (isset($p->encoding) && $p->encoding == "base64") {
+ print base64_encode(file_get_contents($file));
} else {
readfile($file);
}