]> jfr.im git - uguu.git/commitdiff
Update Upload.php
authorGo Johansson (neku) <redacted>
Wed, 2 Aug 2023 19:24:05 +0000 (21:24 +0200)
committerGitHub <redacted>
Wed, 2 Aug 2023 19:24:05 +0000 (21:24 +0200)
src/Classes/Upload.php

index e59e902b17432924062d339eab53686bc3b81daf..e395c87541384aeccb12f8038e444698844c5544 100644 (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,
                    '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 {