From c9429067b1ba0381b678846b63ed1bcb13684d2f Mon Sep 17 00:00:00 2001 From: zero Date: Sat, 28 Jul 2007 11:44:11 +0000 Subject: [PATCH] =?UTF-8?q?=EC=9B=90=EA=B2=A9=20=ED=8C=8C=EC=9D=BC=20?= =?UTF-8?q?=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=EC=8B=9C=20=ED=95=9C?= =?UTF-8?q?=EA=B8=80=ED=8C=8C=EC=9D=BC=EB=AA=85=20=EC=B2=98=EB=A6=AC?= =?UTF-8?q?=ED=95=A0=20=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/trunk@2067 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- classes/file/FileHandler.class.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/classes/file/FileHandler.class.php b/classes/file/FileHandler.class.php index e8c05713b..ff88d5711 100644 --- a/classes/file/FileHandler.class.php +++ b/classes/file/FileHandler.class.php @@ -137,8 +137,20 @@ $fp = @fsockopen($url_info['host'], $url_info['port']); if(!$fp) return; - $url_info['path'] = str_replace(' ','%20',$url_info['path']); - $header = sprintf("GET %s HTTP/1.0\r\nHost: %s\r\nReferer: %s://%s\r\nRequestUrl: %s\r\n\r\n", $url_info['path'], $url_info['host'], $url_info['scheme'], $url_info['host'], Context::getRequestUri()); + // 한글 파일이 있으면 한글파일 부분만 urlencode하여 처리 (iconv 필수) + $path = $url_info['path']; + if(preg_match('/[\xEA-\xED][\x80-\xFF]{2}/', $path)&&function_exists('iconv')) { + $path_list = explode('/',$path); + $cnt = count($path_list); + $filename = $path_list[$cnt-1]; + $filename = urlencode(iconv("UTF-8","EUC-KR",$filename)); + $path_list[$cnt-1] = $filename; + $path = implode('/',$path_list); + $url_info['path'] = $path; + } + + $header = sprintf("GET %s HTTP/2.0\r\nHost: %s\r\nReferer: %s://%s\r\nRequestUrl: %s\r\n\r\n", $url_info['path'], $url_info['host'], $url_info['scheme'], $url_info['host'], Context::getRequestUri()); + @fwrite($fp, $header); $ft = @fopen($target_filename, 'w');