MDL-48799 Files API: fixed legacy directory fallback.

This commit is contained in:
Matteo Scaramuccia
2015-02-01 09:02:37 +01:00
parent 4c27f52d91
commit 6c6147bb29
+2 -1
View File
@@ -87,7 +87,8 @@ if (!$file = $fs->get_file_by_hash(sha1($fullpath))) {
if (strrpos($fullpath, '/') !== strlen($fullpath) -1 ) {
$fullpath .= '/';
}
if (!$file = $fs->get_file_by_hash(sha1($fullpath.'/.'))) {
// Try to fallback to the directory named as the supposed file.
if (!$file = $fs->get_file_by_hash(sha1($fullpath.'.'))) {
send_file_not_found();
}
}