From c032ed6647404eed7e6ff622faafda0262e47cbe Mon Sep 17 00:00:00 2001 From: thisgun Date: Mon, 26 Feb 2018 16:37:05 +0900 Subject: [PATCH] =?UTF-8?q?=EC=B2=A8=EB=B6=80=ED=8C=8C=EC=9D=BC=EB=AA=85?= =?UTF-8?q?=EC=9D=B4=20=EC=99=B8=EA=B5=AD=EC=96=B4=EC=9D=BC=EC=8B=9C=20=20?= =?UTF-8?q?=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20=EC=9D=B4=EC=8A=88=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bbs/download.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bbs/download.php b/bbs/download.php index 977f17674..ba4c8b0d7 100644 --- a/bbs/download.php +++ b/bbs/download.php @@ -76,8 +76,12 @@ if (!get_session($ss_name)) $g5['title'] = '다운로드 > '.conv_subject($write['wr_subject'], 255); -//$original = urlencode($file['bf_source']); -$original = iconv('utf-8', 'euc-kr', $file['bf_source']); // SIR 잉끼님 제안코드 +//파일명에 한글이 있는 경우 +if(preg_match("/[\xA1-\xFE][\xA1-\xFE]/", $file['bf_source'])){ + $original = iconv('utf-8', 'euc-kr', $file['bf_source']); // SIR 잉끼님 제안코드 +} else { + $original = urlencode($file['bf_source']); +} @include_once($board_skin_path.'/download.tail.skin.php'); @@ -86,6 +90,11 @@ if(preg_match("/msie/i", $_SERVER['HTTP_USER_AGENT']) && preg_match("/5\.5/", $_ header("content-length: ".filesize("$filepath")); header("content-disposition: attachment; filename=\"$original\""); header("content-transfer-encoding: binary"); +} else if (preg_match("/Firefox/i", $_SERVER['HTTP_USER_AGENT'])){ + header("content-type: file/unknown"); + header("content-length: ".filesize("$filepath")); + header("content-disposition: attachment; filename=\"".basename($file['bf_source'])."\""); + header("content-description: php generated data"); } else { header("content-type: file/unknown"); header("content-length: ".filesize("$filepath"));