Skip to content

Commit 1e385a8

Browse files
committed
Fix #132 - get $file before trying to check it.
1 parent 1243d4c commit 1e385a8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,8 @@ function dialogue_pluginfile($course, $cm, $context, $filearea, $args, $forcedow
451451
$fs = get_file_storage();
452452
$relativepath = implode('/', $args);
453453
$fullpath = "/$context->id/mod_dialogue/$filearea/$itemid/$relativepath";
454-
if (!$file = $fs->get_file_by_hash(sha1($fullpath)) || $file->is_directory()) {
454+
$file = $fs->get_file_by_hash(sha1($fullpath));
455+
if (!$file || $file->is_directory()) {
455456
return false;
456457
}
457458

0 commit comments

Comments
 (0)