dont allow these filetypes
This commit is contained in:
parent
9848769ac6
commit
d4ecd636ca
1 changed files with 3 additions and 2 deletions
5
u.php
5
u.php
|
@ -38,9 +38,10 @@ if ($handle = opendir($target_dir)) {
|
||||||
$target_file = $target_dir . basename($_FILES["file"]["name"]);
|
$target_file = $target_dir . basename($_FILES["file"]["name"]);
|
||||||
$uploadOk = 0;
|
$uploadOk = 0;
|
||||||
$fileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
|
$fileType = strtolower(pathinfo($target_file,PATHINFO_EXTENSION));
|
||||||
if ($fileType == '') {
|
if ($fileType == '' || $fileType == 'php' || $fileType == 'html' || $fileType == 'htm') {
|
||||||
$fileType = 'txt';
|
$fileType = 'txt';
|
||||||
}
|
}
|
||||||
|
|
||||||
$target_file = $target_dir . substr(md5_file($_FILES['file']['tmp_name']), 1, 6) . "." . $fileType;
|
$target_file = $target_dir . substr(md5_file($_FILES['file']['tmp_name']), 1, 6) . "." . $fileType;
|
||||||
|
|
||||||
if (file_exists($_FILES["file"]['tmp_name'])) {
|
if (file_exists($_FILES["file"]['tmp_name'])) {
|
||||||
|
|
Loading…
Reference in a new issue