mirror of https://github.com/itflow-org/itflow
Use MD5 hashing instead of SHA256 on file uploads which is way faster and still provides a unique file reference
This commit is contained in:
parent
4378fc2719
commit
b803ba4c55
|
|
@ -751,7 +751,7 @@ function checkFileUpload($file, $allowed_extensions)
|
||||||
$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('md5', $fileContent);
|
||||||
|
|
||||||
// Generate a secure filename using the hashed content
|
// Generate a secure filename using the hashed content
|
||||||
$secureFilename = $hashedContent . randomString(2) . '.' . $extension;
|
$secureFilename = $hashedContent . randomString(2) . '.' . $extension;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue