Update Upload.php

pull/86/merge
Go Johansson (neku) 2023-08-02 21:24:05 +02:00 committed by GitHub
parent 187dfc7404
commit fe5fd1ac7c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -28,7 +28,7 @@
/**
* Takes an array of files, and returns an array of arrays containing the file's temporary name,
* name, size, SHA1 hash, extension, and MIME type
* name, size, XXH3 hash, extension, and MIME type
*
* @param $files array The files array from the $_FILES superglobal.
*
@ -44,7 +44,7 @@
'TEMP_NAME' => $file['tmp_name'],
'NAME' => strip_tags($this->checkNameLength($file['name'])),
'SIZE' => $file['size'],
'XXH' => hash('xxh3', $file['tmp_name']),
'XXH' => hash_file('xxh3', $file['tmp_name']),
'EXTENSION' => $this->fileExtension($file),
'MIME' => $this->fileMIME($file),
'DUPE' => false,
@ -199,7 +199,7 @@
'timestamp' => time(),
'useragent' => $USER_AGENT,
'ip' => $ip,
'ip_hash' => hash('sha1', $_SERVER['REMOTE_ADDR'] . $USER_AGENT),
'ip_hash' => hash('xxh3', $_SERVER['REMOTE_ADDR'] . $USER_AGENT),
'files_amount' => $files_amount,
];
} else {