주제: 첨부파일에 한글이 있을 경우 깨집니다.
첨부파일에 한글이 있는 경우 다운로드시 깨집니다.
제가 사용중인 버전은 1.8.3.1이고, PHP 5.3입니다.
아래와 같이 수정하면 Firefox/IE에서는 한글로 받을 수 있더군요.
tc/interface/blog/attachment.php
line 24에 아래와 같은 내용 추가
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$is_msie6 = false;
$msie6_str = strstr($user_agent, 'MSIE');
if($msie6_str != FALSE)
$is_msie6 = true;
$file_label = $attachment['label'];
$file_label_encoded = rawurlencode($file_label);
$file_label_base64 = '=?utf-8?b?' . base64_encode($file_label) . '?=';line 25를 아래와 같이 변경합니다.
원본
header('Content-Disposition: attachment; filename="' . rawurlencode(UTF8::bring($attachment['lab el'])) . '"');수정본
if($is_msie6)
header('Content-Disposition: attachment; filename="' . $file_label_encoded . '"');
else
header('Content-Disposition: attachment; filename="' . $file_label_base64 . '"');이렇게 하면 IE에서는 한글이 보이기는 하는데 [1]같은 문자가 추가되더군요. 자세한 테스트는 안 해봐서 모르겠습니다.
noneofnone (2010-04-06 19:36:41)에 의해 마지막으로 수정