From 756d83e349617bf51bca03f64e82addee192e5de Mon Sep 17 00:00:00 2001 From: zero Date: Wed, 9 Jan 2008 07:25:55 +0000 Subject: [PATCH] =?UTF-8?q?#374=20=EB=AC=B8=EC=9E=90=EC=97=B4=20=EC=9E=90?= =?UTF-8?q?=EB=A5=BC=EB=95=8C=20html=EC=BD=94=EB=93=9C=EC=97=90=20?= =?UTF-8?q?=EB=8C=80=ED=95=9C=20=EB=8C=80=EB=B9=84=EB=A5=BC=20=ED=95=98?= =?UTF-8?q?=EA=B3=A0=20=EC=9E=90=EB=A5=B4=EA=B2=8C=20=ED=95=98=EC=97=AC=20?= =?UTF-8?q?=EA=B0=80=EB=8A=A5=ED=95=9C=20=EC=A0=95=EC=83=81=EC=A0=81?= =?UTF-8?q?=EC=9C=BC=EB=A1=9C=20=EB=85=B8=EC=B6=9C=EB=90=98=EB=8F=84?= =?UTF-8?q?=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/sandbox@3517 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/comment/comment.item.php | 13 +++++++++++-- modules/document/document.item.php | 13 ++++++++++--- 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/modules/comment/comment.item.php b/modules/comment/comment.item.php index a4b852181..5b89f67cd 100644 --- a/modules/comment/comment.item.php +++ b/modules/comment/comment.item.php @@ -186,8 +186,17 @@ } function getSummary($str_size = 50) { - $content = htmlspecialchars(strip_tags(str_replace(" "," ",$this->getContent(false)))); - return cut_str($content, $str_size, '...'); + // 먼저 태그들을 제거함 + $content = preg_replace('!<([^>]*?)>!is','', $this->getContent(false,false)); + + // < , > , " 를 치환 + $content = str_replace(array('<','>','"',' '), array('<','>','"',' '), $content); + + // 문자열을 자름 + $content = cut_str($content, $str_size, '...'); + + // >, <, "를 다시 복구 + return str_replace(array('<','>','"',' '),array('<','>','"',' '), $content); } function getRegdate($format = 'Y.m.d H:i:s') { diff --git a/modules/document/document.item.php b/modules/document/document.item.php index 8809228f7..cb71adde2 100644 --- a/modules/document/document.item.php +++ b/modules/document/document.item.php @@ -274,10 +274,17 @@ } function getSummary($str_size = 50) { - if(!$this->document_srl) return; + // 먼저 태그들을 제거함 + $content = preg_replace('!<([^>]*?)>!is','', $this->getContent(false,false)); - $content = htmlspecialchars(strip_tags(str_replace(" "," ",$this->getContent(false)))); - return cut_str($content, $str_size, '...'); + // < , > , " 를 치환 + $content = str_replace(array('<','>','"',' '), array('<','>','"',' '), $content); + + // 문자열을 자름 + $content = cut_str($content, $str_size, '...'); + + // >, <, "를 다시 복구 + return str_replace(array('<','>','"',' '),array('<','>','"',' '), $content); } function getRegdate($format = 'Y.m.d H:i:s') {