convertHTML() 로 변경

This commit is contained in:
conory 2017-07-13 11:15:12 +09:00
parent da0ad3bd39
commit 820c725d69
5 changed files with 44 additions and 80 deletions

View file

@ -438,9 +438,9 @@ class commentController extends comment
// if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_inserted)
{
$obj->content = $oCommentModel->filterHtml($obj);
$obj->content = getModel('editor')->convertHTML($obj);
}
if(!$obj->regdate)
{
$obj->regdate = date("YmdHis");
@ -784,13 +784,13 @@ class commentController extends comment
{
return new Object(-1, 'msg_empty_content');
}
// if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_updated)
{
$obj->content = $oCommentModel->filterHtml($obj);
$obj->content = getModel('editor')->convertHTML($obj);
}
// remove iframe and script if not a top administrator on the session
if($logged_info->is_admin != 'Y')
{

View file

@ -952,42 +952,6 @@ class commentModel extends comment
return $comment_config;
}
/**
* Return filtered content
* @param object $obj
* @return string
*/
function filterHtml($obj)
{
$no_html = false;
$editor_config = getModel('editor')->getEditorConfig($obj->module_srl);
if ($editor_config->allow_html === 'N')
{
$no_html = true;
}
elseif (strpos($editor_config->sel_comment_editor_colorset, 'nohtml') !== false)
{
$no_html = true;
}
elseif ($obj->use_html === 'N')
{
$no_html = true;
}
if ($no_html || $obj->use_editor === 'N' || !is_html_content($obj->content))
{
if ($no_html)
{
$obj->content = escape(strip_tags($obj->content), false);
}
$obj->content = nl2br($obj->content);
}
return $obj->content;
}
/**
* Return a list of voting member
* @return void