From 69ca119b10c0a48aeef9562649f045cc869ada48 Mon Sep 17 00:00:00 2001 From: chicpro Date: Tue, 10 Nov 2015 14:26:17 +0900 Subject: [PATCH] =?UTF-8?q?=EC=97=85=EB=A1=9C=EB=93=9C=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=EB=AA=85=20=EC=BD=94=EB=93=9C=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/qawrite_update.php | 2 +- bbs/write_update.php | 2 +- lib/common.lib.php | 11 +++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/bbs/qawrite_update.php b/bbs/qawrite_update.php index a58255b098..80663951d6 100644 --- a/bbs/qawrite_update.php +++ b/bbs/qawrite_update.php @@ -187,7 +187,7 @@ $shuffle = implode('', $chars_array); // 첨부파일 첨부시 첨부파일명에 공백이 포함되어 있으면 일부 PC에서 보이지 않거나 다운로드 되지 않는 현상이 있습니다. (길상여의 님 090925) - $upload[$i]['file'] = abs(ip2long($_SERVER['REMOTE_ADDR'])).'_'.substr($shuffle,0,8).'_'.str_replace('%', '', urlencode(str_replace(' ', '_', $filename))); + $upload[$i]['file'] = abs(ip2long($_SERVER['REMOTE_ADDR'])).'_'.substr($shuffle,0,8).'_'.replace_filename($filename); $dest_file = G5_DATA_PATH.'/qa/'.$upload[$i]['file']; diff --git a/bbs/write_update.php b/bbs/write_update.php index 5310d2e167..109ae17c34 100644 --- a/bbs/write_update.php +++ b/bbs/write_update.php @@ -485,7 +485,7 @@ $shuffle = implode('', $chars_array); // 첨부파일 첨부시 첨부파일명에 공백이 포함되어 있으면 일부 PC에서 보이지 않거나 다운로드 되지 않는 현상이 있습니다. (길상여의 님 090925) - $upload[$i]['file'] = abs(ip2long($_SERVER['REMOTE_ADDR'])).'_'.substr($shuffle,0,8).'_'.str_replace('%', '', urlencode(str_replace(' ', '_', $filename))); + $upload[$i]['file'] = abs(ip2long($_SERVER['REMOTE_ADDR'])).'_'.substr($shuffle,0,8).'_'.replace_filename($filename); $dest_file = G5_DATA_PATH.'/file/'.$bo_table.'/'.$upload[$i]['file']; diff --git a/lib/common.lib.php b/lib/common.lib.php index 55e168eb18..dbce98d82c 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -2914,6 +2914,17 @@ function get_safe_filename($name) return $name; } +// 파일명 치환 +function replace_filename($name) +{ + @session_start(); + $ss_id = session_id(); + $usec = get_microtime(); + $ext = array_pop(explode('.', $name)); + + return sha1($ss_id.$_SERVER['REMOTE_ADDR'].$usec).'.'.$ext; +} + // 아이코드 사용자정보 function get_icode_userinfo($id, $pass) {