From 1e34610c4e6deabdf9585fcdd9aa56a81f511a5d Mon Sep 17 00:00:00 2001 From: Fred Woolard Date: Sun, 30 May 2021 17:59:58 -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 535942602ce..bcf30b50566 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;