이미지 파일 업로드 기능을 이용한 웹변조 방지 코드 적용 (나창호님,레이딘님,210915)

This commit is contained in:
kagla
2021-09-15 02:30:19 +00:00
parent bdd52dae6f
commit a3e8c97ef5

View File

@ -77,7 +77,7 @@ run_event('cheditor_photo_upload', $data_dir, $data_url);
//
$tempfile = $_FILES['file']['tmp_name'];
$filename = $_FILES['file']['name'];
$filename_len = strrpos($filename, ".");
$type = substr($filename, strrpos($filename, ".")+1);
$found = false;
switch ($type) {
@ -89,7 +89,7 @@ switch ($type) {
$found = true;
}
if ($found != true) {
if ($found != true || $filename_len != 23) {
exit;
}