mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-05-23 04:49:11 -04:00
Fix for ticket #1110. Need to use the encode_path with a movie extension to find the item. Thanks to samdavidoff for the initial fix.
This commit is contained in:
@@ -60,12 +60,12 @@ class File_Proxy_Controller extends Controller {
|
||||
foreach (explode("/", $path) as $path_part) {
|
||||
$encoded_path[] = rawurlencode($path_part);
|
||||
}
|
||||
|
||||
$encoded_path = implode("/", $encoded_path);
|
||||
// We now have the relative path to the item. Search for it in the path cache
|
||||
// The patch cache is urlencoded so re-encode the path. (it was decoded earlier to
|
||||
// insure that the paths are normalized.
|
||||
$item = ORM::factory("item")
|
||||
->where("relative_path_cache", "=", implode("/", $encoded_path))->find();
|
||||
->where("relative_path_cache", "=", $encoded_path)->find();
|
||||
if (!$item->loaded()) {
|
||||
// We didn't turn it up. It's possible that the relative_path_cache is out of date here.
|
||||
// There was fallback code, but bharat deleted it in 8f1bca74. If it turns out to be
|
||||
@@ -76,7 +76,7 @@ class File_Proxy_Controller extends Controller {
|
||||
// So try some alternate types:
|
||||
if (preg_match('/.jpg$/', $path)) {
|
||||
foreach (array("flv", "mp4") as $ext) {
|
||||
$movie_path = preg_replace('/.jpg$/', ".$ext", $path);
|
||||
$movie_path = preg_replace('/.jpg$/', ".$ext", $encoded_path);
|
||||
$item = ORM::factory("item")->where("relative_path_cache", "=", $movie_path)->find();
|
||||
if ($item->loaded()) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user