mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-05-10 20:44:28 +09:00
convertHTML() 로 변경
This commit is contained in:
parent
da0ad3bd39
commit
820c725d69
5 changed files with 44 additions and 80 deletions
|
|
@ -438,7 +438,7 @@ 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)
|
||||||
{
|
{
|
||||||
$obj->content = $oCommentModel->filterHtml($obj);
|
$obj->content = getModel('editor')->convertHTML($obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$obj->regdate)
|
if(!$obj->regdate)
|
||||||
|
|
@ -788,7 +788,7 @@ 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)
|
||||||
{
|
{
|
||||||
$obj->content = $oCommentModel->filterHtml($obj);
|
$obj->content = getModel('editor')->convertHTML($obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// remove iframe and script if not a top administrator on the session
|
// remove iframe and script if not a top administrator on the session
|
||||||
|
|
|
||||||
|
|
@ -952,42 +952,6 @@ class commentModel extends comment
|
||||||
return $comment_config;
|
return $comment_config;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return filtered content
|
|
||||||
* @param object $obj
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function filterHtml($obj)
|
|
||||||
{
|
|
||||||
$no_html = false;
|
|
||||||
$editor_config = getModel('editor')->getEditorConfig($obj->module_srl);
|
|
||||||
|
|
||||||
if ($editor_config->allow_html === 'N')
|
|
||||||
{
|
|
||||||
$no_html = true;
|
|
||||||
}
|
|
||||||
elseif (strpos($editor_config->sel_comment_editor_colorset, 'nohtml') !== false)
|
|
||||||
{
|
|
||||||
$no_html = true;
|
|
||||||
}
|
|
||||||
elseif ($obj->use_html === 'N')
|
|
||||||
{
|
|
||||||
$no_html = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($no_html || $obj->use_editor === 'N' || !is_html_content($obj->content))
|
|
||||||
{
|
|
||||||
if ($no_html)
|
|
||||||
{
|
|
||||||
$obj->content = escape(strip_tags($obj->content), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
$obj->content = nl2br($obj->content);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $obj->content;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a list of voting member
|
* Return a list of voting member
|
||||||
* @return void
|
* @return void
|
||||||
|
|
|
||||||
|
|
@ -457,7 +457,7 @@ 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)
|
||||||
{
|
{
|
||||||
$obj->content = $oDocumentModel->filterHtml($obj);
|
$obj->content = getModel('editor')->convertHTML($obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove iframe and script if not a top adminisrator in the session.
|
// Remove iframe and script if not a top adminisrator in the session.
|
||||||
|
|
@ -695,7 +695,7 @@ 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)
|
||||||
{
|
{
|
||||||
$obj->content = $oDocumentModel->filterHtml($obj);
|
$obj->content = getModel('editor')->convertHTML($obj);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Change not extra vars but language code of the original document if document's lang_code is different from author's setting.
|
// Change not extra vars but language code of the original document if document's lang_code is different from author's setting.
|
||||||
|
|
|
||||||
|
|
@ -1247,42 +1247,6 @@ class documentModel extends document
|
||||||
else return $lang->status_name_list;
|
else return $lang->status_name_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return filtered content
|
|
||||||
* @param object $obj
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
function filterHtml($obj)
|
|
||||||
{
|
|
||||||
$no_html = false;
|
|
||||||
$editor_config = getModel('editor')->getEditorConfig($obj->module_srl);
|
|
||||||
|
|
||||||
if ($editor_config->allow_html === 'N')
|
|
||||||
{
|
|
||||||
$no_html = true;
|
|
||||||
}
|
|
||||||
elseif (strpos($editor_config->sel_editor_colorset, 'nohtml') !== false)
|
|
||||||
{
|
|
||||||
$no_html = true;
|
|
||||||
}
|
|
||||||
elseif ($obj->use_html === 'N')
|
|
||||||
{
|
|
||||||
$no_html = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($no_html || $obj->use_editor === 'N' || !is_html_content($obj->content))
|
|
||||||
{
|
|
||||||
if ($no_html)
|
|
||||||
{
|
|
||||||
$obj->content = escape(strip_tags($obj->content), false);
|
|
||||||
}
|
|
||||||
|
|
||||||
$obj->content = nl2br($obj->content);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $obj->content;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setting sort index
|
* Setting sort index
|
||||||
* @param object $obj
|
* @param object $obj
|
||||||
|
|
|
||||||
|
|
@ -869,6 +869,42 @@ class editorModel extends editor
|
||||||
|
|
||||||
return $component_info;
|
return $component_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return converted content
|
||||||
|
* @param object $obj
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
function convertHTML($obj)
|
||||||
|
{
|
||||||
|
$no_html = false;
|
||||||
|
$editor_config = $this->getEditorConfig($obj->module_srl);
|
||||||
|
|
||||||
|
if ($editor_config->allow_html === 'N')
|
||||||
|
{
|
||||||
|
$no_html = true;
|
||||||
|
}
|
||||||
|
elseif (strpos($obj->title ? $editor_config->sel_editor_colorset : $editor_config->sel_comment_editor_colorset, 'nohtml') !== false)
|
||||||
|
{
|
||||||
|
$no_html = true;
|
||||||
|
}
|
||||||
|
elseif ($obj->use_html === 'N')
|
||||||
|
{
|
||||||
|
$no_html = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($no_html || $obj->use_editor === 'N' || !is_html_content($obj->content))
|
||||||
|
{
|
||||||
|
if ($no_html)
|
||||||
|
{
|
||||||
|
$obj->content = escape(strip_tags($obj->content), false);
|
||||||
|
}
|
||||||
|
|
||||||
|
$obj->content = nl2br($obj->content);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $obj->content;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/* End of file editor.model.php */
|
/* End of file editor.model.php */
|
||||||
/* Location: ./modules/editor/editor.model.php */
|
/* Location: ./modules/editor/editor.model.php */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue