From 6c6147bb29d3dbf42965098d0d96a7fa09542bb3 Mon Sep 17 00:00:00 2001 From: Matteo Scaramuccia Date: Sun, 11 Jan 2015 09:38:56 +0100 Subject: [PATCH] MDL-48799 Files API: fixed legacy directory fallback. --- file.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/file.php b/file.php index 3dc8449e43f..61e563245f3 100644 --- a/file.php +++ b/file.php @@ -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(); } }