From 99eae85be4cc069fed135ecb5c9de6ef3bb10d38 Mon Sep 17 00:00:00 2001 From: Fred Woolard Date: Sun, 30 May 2021 18:25:37 -0400 Subject: [PATCH] MDL-71777 antivirus: Use hash_from_path (sha1_file) --- lib/classes/antivirus/scanner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/classes/antivirus/scanner.php b/lib/classes/antivirus/scanner.php index c12d6a5771d..c20cb040afc 100644 --- a/lib/classes/antivirus/scanner.php +++ b/lib/classes/antivirus/scanner.php @@ -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;