Do not allow HTML content if editor config says nohtml

This commit is contained in:
Kijin Sung 2017-06-29 19:23:39 +09:00
parent 67e02824e3
commit 1d2368f105
2 changed files with 24 additions and 4 deletions

View file

@ -436,7 +436,12 @@ class commentController extends comment
// if use editor of nohtml, Remove HTML tags from the contents. // if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_inserted) if(!$manual_inserted)
{ {
if ($obj->use_editor === 'Y' || $obj->use_html === 'Y') $editor_config = getModel('editor')->getEditorConfig($obj->module_srl);
if (strpos($editor_config->comment_editor_skin, 'textarea') !== false || strpos($editor_config->sel_comment_editor_colorset, 'nohtml') !== false)
{
$is_html_content = false;
}
elseif ($obj->use_editor === 'Y' || $obj->use_html === 'Y')
{ {
$is_html_content = true; $is_html_content = true;
} }
@ -805,7 +810,12 @@ class commentController extends comment
// if use editor of nohtml, Remove HTML tags from the contents. // if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_updated) if(!$manual_updated)
{ {
if ($obj->use_editor === 'Y' || $obj->use_html === 'Y') $editor_config = getModel('editor')->getEditorConfig($obj->module_srl);
if (strpos($editor_config->comment_editor_skin, 'textarea') !== false || strpos($editor_config->sel_comment_editor_colorset, 'nohtml') !== false)
{
$is_html_content = false;
}
elseif ($obj->use_editor === 'Y' || $obj->use_html === 'Y')
{ {
$is_html_content = true; $is_html_content = true;
} }

View file

@ -457,7 +457,12 @@ class documentController extends document
// if use editor of nohtml, Remove HTML tags from the contents. // if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_inserted) if(!$manual_inserted)
{ {
if ($obj->use_editor === 'Y' || $obj->use_html === 'Y') $editor_config = getModel('editor')->getEditorConfig($obj->module_srl);
if (strpos($editor_config->comment_editor_skin, 'textarea') !== false || strpos($editor_config->sel_comment_editor_colorset, 'nohtml') !== false)
{
$is_html_content = false;
}
elseif ($obj->use_editor === 'Y' || $obj->use_html === 'Y')
{ {
$is_html_content = true; $is_html_content = true;
} }
@ -711,7 +716,12 @@ class documentController extends document
// if use editor of nohtml, Remove HTML tags from the contents. // if use editor of nohtml, Remove HTML tags from the contents.
if(!$manual_updated) if(!$manual_updated)
{ {
if ($obj->use_editor === 'Y' || $obj->use_html === 'Y') $editor_config = getModel('editor')->getEditorConfig($obj->module_srl);
if (strpos($editor_config->comment_editor_skin, 'textarea') !== false || strpos($editor_config->sel_comment_editor_colorset, 'nohtml') !== false)
{
$is_html_content = false;
}
elseif ($obj->use_editor === 'Y' || $obj->use_html === 'Y')
{ {
$is_html_content = true; $is_html_content = true;
} }