From d4ecd636cacdd9d1b5e82dc96bcec3b0728189a3 Mon Sep 17 00:00:00 2001 From: owen Date: Tue, 1 Dec 2020 21:16:50 -0500 Subject: [PATCH] dont allow these filetypes --- u.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/u.php b/u.php index ce3debf..c8f80a1 100644 --- a/u.php +++ b/u.php @@ -38,9 +38,10 @@ if ($handle = opendir($target_dir)) { $target_file = $target_dir . basename($_FILES["file"]["name"]); $uploadOk = 0; $fileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION)); -if ($fileType == '') { - $fileType = 'txt'; +if ($fileType == '' || $fileType == 'php' || $fileType == 'html' || $fileType == 'htm') { + $fileType = 'txt'; } + $target_file = $target_dir . substr(md5_file($_FILES['file']['tmp_name']), 1, 6) . "." . $fileType; if (file_exists($_FILES["file"]['tmp_name'])) {