From 00a4e1aa25501c1ceaa697bf7669cfb2343c1dbd Mon Sep 17 00:00:00 2001 From: Vincent LAURENT Date: Tue, 21 Sep 2021 19:11:06 +0200 Subject: [PATCH] =?UTF-8?q?cle=20de=20fichier=20al=C3=A9atoire?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index c91bf95..bdd8401 100644 --- a/index.php +++ b/index.php @@ -32,7 +32,7 @@ $f3->route('POST /upload', if(!$valid) { continue; } - $key = md5_file($file); + $key = substr(hash('sha256', hash_file('sha256', $file).uniqid()), 0, 24); rename($file, $f3->get('UPLOADS').'/'.$key.'.pdf'); }