check nohtml editor comment

This commit is contained in:
Xvezda 2015-04-04 00:56:18 +09:00
parent e308a5035b
commit 5f986dd7fb

View file

@ -326,6 +326,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 = htmlspecialchars($obj->content, ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
}
}
if(!$obj->regdate)
{
@ -729,6 +739,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 = 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')