summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/file_proxy.php
diff options
context:
space:
mode:
authorNathan Kinkade <nkinkade@nkinka.de>2010-08-06 21:36:32 +0000
committerNathan Kinkade <nkinkade@nkinka.de>2010-08-06 21:36:32 +0000
commit691ce806dc9aefac596a692ff2ba927a81a65440 (patch)
tree410f64288ef1d8bbc8455509af74d0e7582dc48e /modules/gallery/controllers/file_proxy.php
parentc83650d83ad8b1f4bda30cac2ae8efa6e1c97287 (diff)
parent8559cdb5b6bfa87864941f726521660023779fa7 (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.php11
1 files changed, 4 insertions, 7 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 32690fc0..15b4279f 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -72,10 +72,10 @@ class File_Proxy_Controller extends Controller {
// necessary, it's easily resurrected.
// If we're looking for a .jpg then it's it's possible that we're requesting the thumbnail
- // for a movie. In that case, the .flv or .mp4 file would have been converted to a .jpg.
- // So try some alternate types:
+ // for a movie. In that case, the .flv, .mp4 or .m4v file would have been converted to a
+ // .jpg. So try some alternate types:
if (preg_match('/.jpg$/', $path)) {
- foreach (array("flv", "mp4") as $ext) {
+ foreach (array("flv", "mp4", "m4v") as $ext) {
$movie_path = preg_replace('/.jpg$/', ".$ext", $encoded_path);
$item = ORM::factory("item")->where("relative_path_cache", "=", $movie_path)->find();
if ($item->loaded()) {
@@ -131,10 +131,7 @@ class File_Proxy_Controller extends Controller {
} else {
header("Content-Type: $item->mime_type");
}
-
Kohana::close_buffers(false);
- $fd = fopen($file, "rb");
- fpassthru($fd);
- fclose($fd);
+ readfile($file);
}
}