From 2633477575b3dde3e0b328db28f1be1a17d26cd0 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 23 Aug 2023 16:04:42 -0400 Subject: [PATCH] Added Commented code to has the file contents itself instead of the name --- functions.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index 1607338f..03e34eaf 100644 --- a/functions.php +++ b/functions.php @@ -635,7 +635,14 @@ function checkFileUpload($file, $allowed_extensions) { return "File size exceeds the limit."; } - // Perform additional content-based validation here, if needed + // Read the file content + //$fileContent = file_get_contents($tmp); + + // Hash the file content using SHA-256 + //$hashedContent = hash('sha256', $fileContent); + + // Generate a secure filename using the hashed content + //$secureFilename = $hashedContent . '.' . $extension; // Generate a secure filename using SHA-256 $secureFilename = hash('sha256', time() . $name) . '.' . $extension;