1
0
mirror of https://github.com/nokonoko/Uguu.git synced 2024-01-06 13:35:15 +00:00

Update Upload.php

This commit is contained in:
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

View File

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