summaryrefslogtreecommitdiff
path: root/modules/gallery/controllers/file_proxy.php
diff options
context:
space:
mode:
authorNathan Kinkade <nath@nkinka.de>2013-03-19 16:41:42 +0000
committerNathan Kinkade <nath@nkinka.de>2013-03-19 16:41:42 +0000
commit3908e37d965fa76ea774e76ddf42365a872a5f27 (patch)
tree457e1a1e465f83855eee96ba287cd91f1623395c /modules/gallery/controllers/file_proxy.php
parent711651f727e093cc7357a6bbff6bd992fd6dfd80 (diff)
parent1eab94f6062b5f54ea5d9db01d968e7195f3de9d (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.php21
1 files changed, 2 insertions, 19 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php
index 7e5d0038..50f1aa26 100644
--- a/modules/gallery/controllers/file_proxy.php
+++ b/modules/gallery/controllers/file_proxy.php
@@ -66,24 +66,8 @@ class File_Proxy_Controller extends Controller {
throw $e;
}
- // If the last element is .album.jpg, pop that off since it's not a real item
- $path = preg_replace("|/.album.jpg$|", "", $path);
-
- $item = item::find_by_path($path);
- if (!$item->loaded()) {
- // We didn't turn it up. 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 movie file would
- // have been converted to a .jpg. So try some alternate types:
- if (preg_match('/.jpg$/', $path)) {
- foreach (legal_file::get_movie_extensions() as $ext) {
- $movie_path = preg_replace('/.jpg$/', ".$ext", $path);
- $item = item::find_by_path($movie_path);
- if ($item->loaded()) {
- break;
- }
- }
- }
- }
+ // Get the item model using the path and type (which corresponds to a var subdir)
+ $item = item::find_by_path($path, $type);
if (!$item->loaded()) {
$e = new Kohana_404_Exception();
@@ -162,7 +146,6 @@ 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()) {
- 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).