From f06f2c4ae0f620fe967e5617522b3ee5ea9e13e4 Mon Sep 17 00:00:00 2001 From: zero Date: Thu, 9 Aug 2007 13:09:30 +0000 Subject: [PATCH] =?UTF-8?q?=EC=A0=9C=EB=A1=9C=EB=B3=B4=EB=93=9C=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=9D=B4=EC=A0=84=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=B2=A8=EB=B6=80=ED=8C=8C=EC=9D=BC=20=EC=9D=B4?= =?UTF-8?q?=EC=83=81=EC=97=86=EB=8F=84=EB=A1=9D=20=EC=88=98=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@2278 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../importer/importer.admin.controller.php | 29 +++++++++++-------- modules/importer/tpl/js/importer_admin.js | 2 +- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/modules/importer/importer.admin.controller.php b/modules/importer/importer.admin.controller.php index 427bacca6..573342c52 100644 --- a/modules/importer/importer.admin.controller.php +++ b/modules/importer/importer.admin.controller.php @@ -300,6 +300,7 @@ function _importDocument($matches) { $sequence = $matches[1]; + $matches[0] = str_replace(array('',''),'',$matches[0]); $xml_doc = $this->oXml->parse($matches[0]); // 문서 번호와 내용 미리 구해 놓기 @@ -317,20 +318,24 @@ $tmp_filename = './files/cache/tmp_uploaded_file'; - if(preg_match('/[\xEA-\xED][\x80-\xFF]{2}/', $path)&&function_exists('iconv')) { - $tmp_path = iconv("UTF-8","EUC-KR",$path); - if(file_exists($tmp_path)) $path = $tmp_path; - } + $path = $this->target_path.$path; - if(file_exists($path)) { - if(!eregi("^http",$this->target_path)) @copy($this->target_path.$path, $tmp_filename); - else FileHandler::getRemoteFile($this->target_path.$path, $tmp_filename); - $file_info['tmp_name'] = $tmp_filename; - $file_info['name'] = $filename; - $this->oFileController->insertFile($file_info, $this->module_srl, $args->document_srl, $download_count, true); + if(!eregi("^http",$path)) { + if(preg_match('/[\xEA-\xED][\x80-\xFF]{2}/', $path)&&function_exists('iconv')) { + $tmp_path = iconv("UTF-8","EUC-KR",$path); + if(file_exists($tmp_path)) $path = $tmp_path; + } + if(file_exists($path)) @copy($path, $tmp_filename); - // 컨텐츠의 내용 수정 (이미지 첨부파일 관련) - $args->content = str_replace($filename, sprintf('./files/attach/images/%s/%s/%s', $this->module_srl, $args->document_srl, $filename), $args->content); + } else FileHandler::getRemoteFile($path, $tmp_filename); + + if(file_exists($tmp_filename)) { + $file_info['tmp_name'] = $tmp_filename; + $file_info['name'] = $filename; + $this->oFileController->insertFile($file_info, $this->module_srl, $args->document_srl, $download_count, true); + + // 컨텐츠의 내용 수정 (이미지 첨부파일 관련) + if(eregi("\.(jpg|gif|jpeg|png)$", $filename)) $args->content = str_replace($filename, sprintf('./files/attach/images/%s/%s/%s', $this->module_srl, $args->document_srl, $filename), $args->content); } @unlink($tmp_filename); } diff --git a/modules/importer/tpl/js/importer_admin.js b/modules/importer/tpl/js/importer_admin.js index aab55c4d7..8b6077718 100644 --- a/modules/importer/tpl/js/importer_admin.js +++ b/modules/importer/tpl/js/importer_admin.js @@ -103,7 +103,7 @@ function completeImport(ret_obj) { if(is_finished=='Y') { alert(ret_obj["message"]); - //location.href = location.href; + location.href = location.href; } else { var fo_obj = xGetElementById('fo_step2'); fo_obj.position.value = position;