mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 17:21:39 +09:00
Exclude scripts and styles from document summary
관리자 권한으로 문서에 스크립트나 스타일을 넣어 놓은 경우 getSummary()에서 해당 내용이 표시되는 문제 수정 <style>CSS</style> 구조로 입력되므로 strip_tags() 사용시 앞뒤의 태그만 삭제되고 중간에 있는 CSS가 그대로 노출될 수 있음.
This commit is contained in:
parent
6b3d201539
commit
e2c7a3eefe
1 changed files with 2 additions and 1 deletions
|
|
@ -765,7 +765,8 @@ class documentItem extends BaseObject
|
|||
function getSummary($str_size = 50, $tail = '...')
|
||||
{
|
||||
// Remove tags
|
||||
$content = strip_tags($this->getContent(false, false));
|
||||
$content = $this->getContent(false, false);
|
||||
$content = strip_tags(preg_replace('!<(style|script)\b.+?</\\1>!is', '', $content));
|
||||
|
||||
// Convert temporarily html entity for truncate
|
||||
$content = html_entity_decode($content, ENT_QUOTES);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue