mirror of
https://github.com/moodle/moodle.git
synced 2025-08-06 09:26:35 +02:00
MDL-48799 Files API: fixed legacy directory fallback.
This commit is contained in:
parent
f25f4caffd
commit
61cff2855e
1 changed files with 2 additions and 1 deletions
3
file.php
3
file.php
|
@ -87,7 +87,8 @@ if (!$file = $fs->get_file_by_hash(sha1($fullpath))) {
|
||||||
if (strrpos($fullpath, '/') !== strlen($fullpath) -1 ) {
|
if (strrpos($fullpath, '/') !== strlen($fullpath) -1 ) {
|
||||||
$fullpath .= '/';
|
$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();
|
send_file_not_found();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue