mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
#374 문자열 자를때 html코드에 대한 대비를 하고 자르게 하여 가능한 정상적으로 노출되도록 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3517 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
bfeaa26f77
commit
756d83e349
2 changed files with 21 additions and 5 deletions
|
|
@ -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') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue