mirror of
https://github.com/itflow-org/itflow
synced 2026-03-10 15:54:51 +00:00
Upon upload the file contents are not hashed in Sha256 and used for the reference file in the DB
This commit is contained in:
@@ -636,16 +636,13 @@ function checkFileUpload($file, $allowed_extensions) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Read the file content
|
// Read the file content
|
||||||
//$fileContent = file_get_contents($tmp);
|
$fileContent = file_get_contents($tmp);
|
||||||
|
|
||||||
// Hash the file content using SHA-256
|
// Hash the file content using SHA-256
|
||||||
//$hashedContent = hash('sha256', $fileContent);
|
$hashedContent = hash('sha256', $fileContent);
|
||||||
|
|
||||||
// Generate a secure filename using the hashed content
|
// Generate a secure filename using the hashed content
|
||||||
//$secureFilename = $hashedContent . '.' . $extension;
|
$secureFilename = $hashedContent . '.' . $extension;
|
||||||
|
|
||||||
// Generate a secure filename using SHA-256
|
|
||||||
$secureFilename = hash('sha256', time() . $name) . '.' . $extension;
|
|
||||||
|
|
||||||
return $secureFilename;
|
return $secureFilename;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user