이미지 상세 보기 페이지 확장자 체크 추가

This commit is contained in:
thisgun
2018-10-17 19:39:00 +09:00
parent 6a01a868d1
commit c8d41381c9

View File

@ -4,7 +4,13 @@ include_once('./_common.php');
$g5['title'] = '이미지 크게보기';
include_once(G5_PATH.'/head.sub.php');
$filename = preg_replace('/[^A-Za-z0-9 _ .-]/', '', $_GET['fn']);
$filename = preg_replace('/[^A-Za-z0-9 _ .-\/]/', '', $_GET['fn']);
$extension = pathinfo($filename, PATHINFO_EXTENSION);
if ( ! preg_match('/(jpg|jpeg|png|gif|bmp)$/i', $extension) ){
alert_close('확장자가 이미지인것만 요청할수 있습니다.');
}
if(strpos($filename, 'data/editor')) {
$editor_file = strstr($filename, 'editor');