From cfe5ae01d3bff94b340b048fa67be1b871b38ecc Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 7 Dec 2017 14:43:54 +0900 Subject: [PATCH] Allow converter to be used even when manually inserted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 익명게시판에서는 댓글 작성시 $manual_inserted = true로 설정되기 때문에 converter가 작동하지 않음. 이런 경우에도 allow_html, use_html 등의 변수가 지정된 경우 converter를 사용하도록 변경하여 에디터를 지원하지 않는 모바일 스킨과의 호환성을 높임. --- modules/comment/comment.controller.php | 6 +++--- modules/document/document.controller.php | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index f0e0e23c0..f2f14cfa3 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -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'); } diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 1129d9db9..1df548280 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -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'); }