From e7d3921bc0509a60454554a01928bb28362a836d Mon Sep 17 00:00:00 2001 From: Beu Date: Mon, 24 Feb 2020 22:49:25 +0100 Subject: [PATCH] prevent the id is not used (#8) --- index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index c3d3744..39b8423 100644 --- a/index.php +++ b/index.php @@ -37,7 +37,11 @@ // Upload File if ($_SERVER['REQUEST_METHOD'] === 'PUT') { - $rnd_data = mt_rand(10000,99999); + do + { + $rnd_data = mt_rand(00000,99999); + } while (file_exists(_DATA_DIR . "/" . $rnd_data)); + $filesize = 0 ; mkdir(_DATA_DIR . "/" . $rnd_data);