Allow converter to be used even when manually inserted

익명게시판에서는 댓글 작성시 $manual_inserted = true로 설정되기 때문에
converter가 작동하지 않음. 이런 경우에도 allow_html, use_html 등의
변수가 지정된 경우 converter를 사용하도록 변경하여
에디터를 지원하지 않는 모바일 스킨과의 호환성을 높임.
This commit is contained in:
Kijin Sung 2017-12-07 14:43:54 +09:00
parent 78a8bd362d
commit cfe5ae01d3
2 changed files with 5 additions and 5 deletions

View file

@ -439,7 +439,7 @@ class commentController extends comment
}
// if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_inserted)
if(!$manual_inserted || isset($obj->allow_html) || isset($obj->use_html))
{
$obj->content = getModel('editor')->converter($obj, 'comment');
}
@ -786,13 +786,13 @@ class commentController extends comment
// remove Rhymix's wn tags from contents
$obj->content = preg_replace('!<\!--(Before|After)(Document|Comment)\(([0-9]+),([0-9]+)\)-->!is', '', $obj->content);
// Return error if content is empty.
if (!$manual_inserted && is_empty_html_content($obj->content))
if (!$manual_updated && is_empty_html_content($obj->content))
{
return new BaseObject(-1, 'msg_empty_content');
}
// if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_updated)
if(!$manual_updated || isset($obj->allow_html) || isset($obj->use_html))
{
$obj->content = getModel('editor')->converter($obj, 'comment');
}

View file

@ -479,7 +479,7 @@ class documentController extends document
}
// if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_inserted)
if(!$manual_inserted || isset($obj->allow_html) || isset($obj->use_html))
{
$obj->content = getModel('editor')->converter($obj, 'document');
}
@ -737,7 +737,7 @@ class documentController extends document
}
// if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_updated)
if(!$manual_updated || isset($obj->allow_html) || isset($obj->use_html))
{
$obj->content = getModel('editor')->converter($obj, 'document');
}