Merge #1371 #1369 에디터 체크하여 HTML 인코딩 by Xvezda

* pr/1371:
  check manual inserted document
  check manual inserted comment
  fix line break bug document
  fix line break bug comment
  nl2br content document
  nl2br content comment
  Update xe_textarea.min.js
  Update xe_textarea.js
  check nohtml editor document
  check nohtml editor comment
This commit is contained in:
Kijin Sung 2015-10-08 14:10:38 +09:00
commit d92311fce0
4 changed files with 41 additions and 2 deletions

View file

@ -330,6 +330,16 @@ class commentController extends comment
}
$obj->content = nl2br($obj->content);
}
else
{
$oModuleModel = getModel('module');
$editor_config = $oModuleModel->getModuleConfig('editor');
if(substr_compare($editor_config->sel_comment_editor_colorset, 'nohtml', -6) === 0 && !$manual_inserted)
{
$obj->content = preg_replace('/\r|\n/', '', nl2br(htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)));
}
}
if(!$obj->regdate)
{
@ -739,6 +749,16 @@ class commentController extends comment
}
$obj->content = nl2br($obj->content);
}
else
{
$oModuleModel = getModel('module');
$editor_config = $oModuleModel->getModuleConfig('editor');
if(substr_compare($editor_config->sel_comment_editor_colorset, 'nohtml', -6) === 0)
{
$obj->content = preg_replace('/\r|\n/', '', nl2br(htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false)));
}
}
// remove iframe and script if not a top administrator on the session
if($logged_info->is_admin != 'Y')