]> git.joonet.de Git - adminer.git/commitdiff
Use a better random string
authorJakub Vrana <jakub@vrana.cz>
Tue, 18 Feb 2025 07:26:07 +0000 (08:26 +0100)
committerJakub Vrana <jakub@vrana.cz>
Wed, 19 Feb 2025 10:16:45 +0000 (11:16 +0100)
plugins/file-upload.php

index af352673139106103d07b15f3ea0581ad0f4eb00..6c40f624dca019da020566286e2ec4699c22811b 100644 (file)
@@ -36,7 +36,7 @@ class AdminerFileUpload {
                                return false;
                        }
                        //! unlink old
-                       $filename = uniqid() . $regs2[0];
+                       $filename = (function_exists('random_bytes') ? bin2hex(random_bytes(8)) : uniqid("", true)) . $regs2[0];
                        if (!move_uploaded_file($_FILES[$name]["tmp_name"], "$this->uploadPath$table/$regs[1]-$filename")) {
                                return false;
                        }