Thumbnails On Protected Videos Are Not Found If Spaces In File Path
|
rlparadise
Joined: 2009-12-27
Posts: 65 |
Posted: Sat, 2010-03-20 01:02
|
|
Working with latest GIT build. PROBLEM: For protected videos that have a directory or file name with a space in them, Gallery 3 will fail to retrieve it in the file proxy. This is due to the fact that the DB query is looking at relative_path_cache which contains an encoded URL. The correct thing is done for images (path is encoded) but the conditional section of the code (for videos only) is not correct. STEPS TO REPRODUCE: - Create an album with spaces in it. POTENTIAL FIX: The way I fixed it was: modules/gallery/controllers/file_proxy.php, lines 81-87
$encoded_path = array();
foreach (explode("/", $movie_path) as $path_part) {
$encoded_path[] = rawurlencode($path_part);
}
$item = ORM::factory("item")->where("relative_path_cache", "=", implode("/", $encoded_path))->find();
A ticket has been created at: |
|

Posts: 337
WOW! That really solves the problem. Actually, I reported this in ticket#1078, was waiting it to get solved. I noted that some videos thumbnails are shown though, but couldn't detect that it's related to the space in the filename.
I'm going to close my ticket as duplicated.. Thanks to share us your solution
Posts: 65
Glad to hear it solved your problem. I saw ticket 1078 when I went to submit mine but couldn't confirm it as a duplicate (although I suspected it might be related).
Although spaces are the most obvious, there are likely other things that trigger this issue. Any URL/path that has to be encoded for special characters can trigger this problem.