mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
윈도우 서버에서 글요약본 추출시 깨어진 문자가 보이는 문제 수정
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@6336 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
06518c972f
commit
16a354d8cb
1 changed files with 8 additions and 4 deletions
|
|
@ -305,8 +305,7 @@
|
|||
}
|
||||
|
||||
function getSummary($str_size = 50, $tail = '...') {
|
||||
// 영문이나 숫자가 연결되어서 20개 이상으로 연결시에 강제 띄움 시도 - {20,}으로 길이를 정하면, 20개 이상 문자열 맨 마지막에 스페이스를 추가할 뿐 원하는 의도는 달성되지 못함
|
||||
$content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is',"$0-",$this->getContent(false,false));
|
||||
$content = $this->getContent(false,false);
|
||||
|
||||
// 줄바꿈이 있을 때, 공백문자 삽입
|
||||
$content = preg_replace('!(<br[\s]*/{0,1}>[\s]*)+!is', ' ', $content);
|
||||
|
|
@ -321,13 +320,18 @@
|
|||
$content = str_replace(array('<','>','"',' '), array('<','>','"',' '), $content);
|
||||
|
||||
// 연속된 공백문자 삭제
|
||||
$content = preg_replace('/([\s]{2,})/is', ' ', $content);
|
||||
$content = preg_replace('/ ( +)/is', ' ', $content);
|
||||
|
||||
// 문자열을 자름
|
||||
$content = trim(cut_str($content, $str_size, $tail));
|
||||
|
||||
// >, <, "를 다시 복구
|
||||
return str_replace(array('<','>','"'),array('<','>','"'), $content);
|
||||
$content = str_replace(array('<','>','"'),array('<','>','"'), $content);
|
||||
|
||||
// 영문이 연결될 경우 개행이 안 되는 문제를 해결
|
||||
$content = preg_replace('/([a-z0-9\+:\/\.\~,\|\!\@\#\$\%\^\&\*\(\)\_]){20}/is',"$0-",$content);
|
||||
|
||||
return $content;
|
||||
}
|
||||
|
||||
function getRegdate($format = 'Y.m.d H:i:s') {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue