diff options
| author | Bharat Mediratta <bharat@menalto.com> | 2013-02-27 09:10:35 -0800 |
|---|---|---|
| committer | Bharat Mediratta <bharat@menalto.com> | 2013-02-27 09:10:35 -0800 |
| commit | ad502513b0ab465cb7578589fdee104edc0e8599 (patch) | |
| tree | f7dd7fa36887727961abd56ff11c25b239327f62 /modules/gallery/controllers/file_proxy.php | |
| parent | 81011785aa8bbaad6dcfe5bb44a247cad778ed75 (diff) | |
| parent | 251e9d5c8f727b886676e010481a6090ddac028c (diff) | |
Merge pull request #156 from shadlaws/fix_2010
#2010 - Revise item::find_by_path to search for jpg-converted items.
Diffstat (limited to 'modules/gallery/controllers/file_proxy.php')
| -rw-r--r-- | modules/gallery/controllers/file_proxy.php | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php index 7e5d0038..ac558a71 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(); |
