MDL-71777 antivirus: Use hash_from_path (sha1_file)

This commit is contained in:
Fred Woolard
2021-06-25 09:52:14 -04:00
parent 017dce9cc3
commit 99eae85be4
+1 -1
View File
@@ -204,7 +204,7 @@ abstract class scanner {
// Check for empty file, or file not uploaded.
if (!empty($file) && filesize($file) !== false) {
$content->filesize = display_size(filesize($file));
$content->contenthash = \file_storage::hash_from_string(file_get_contents($file));
$content->contenthash = \file_storage::hash_from_path($file);
$content->contenttype = mime_content_type($file);
} else {
$content->filesize = $unknown;