From 1d2368f1059e19cd4eb5cb39c72ab56593a909c6 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 29 Jun 2017 19:23:39 +0900 Subject: [PATCH] Do not allow HTML content if editor config says nohtml --- modules/comment/comment.controller.php | 14 ++++++++++++-- modules/document/document.controller.php | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 9b205acd7..f116140ee 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -436,7 +436,12 @@ class commentController extends comment // if use editor of nohtml, Remove HTML tags from the contents. 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; } @@ -805,7 +810,12 @@ class commentController extends comment // if use editor of nohtml, Remove HTML tags from the contents. 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; } diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 0b6bf4418..5b14e545b 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -457,7 +457,12 @@ class documentController extends document // if use editor of nohtml, Remove HTML tags from the contents. 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; } @@ -711,7 +716,12 @@ class documentController extends document // if use editor of nohtml, Remove HTML tags from the contents. 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; }