fixed: static files loaded to /var such as /var/ckeditor_winix.js were not properly returned

(html filter was used but they are mostly javascript files)
added: new Item::ContentType: ct_other
       if an item has ct_other then the html filter is not used for the content





git-svn-id: svn://ttmath.org/publicrep/winix/trunk@1040 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2016-07-13 13:13:56 +00:00
parent 240bf4dc5d
commit e57840faed
20 changed files with 144 additions and 68 deletions

View File

@@ -114,6 +114,9 @@ void item_content_type_is(Item & item, Info & i)
else
if( item.content_type == Item::ct_bbcode && i.par == L"bbcode" )
i.res = true;
else
if( item.content_type == Item::ct_other && i.par == L"other" )
i.res = true;
}
@@ -125,6 +128,9 @@ void item_content_type_is(Info & i)
void item_print_content(HtmlTextStream & out, const std::wstring & content, Item::ContentType content_type)
{
if( config->html_filter && !Item::CanContentBeHtmlFiltered(content_type) )
out << R("<nofilter>");
if( content_type == Item::ct_text )
{
out << content;
@@ -135,11 +141,6 @@ void item_print_content(HtmlTextStream & out, const std::wstring & content, Item
HtmlEscapeFormTxt(out, content);
}
else
if( content_type == Item::ct_html )
{
out << R(content);
}
else
if( content_type == Item::ct_bbcode )
{
static std::wstring out_temp;
@@ -149,6 +150,14 @@ void item_print_content(HtmlTextStream & out, const std::wstring & content, Item
bbcode_parser.Filter(content.c_str(), out_temp);
out << R(out_temp);
}
else
{
// ct_html, ct_other
out << R(content);
}
if( config->html_filter && !Item::CanContentBeHtmlFiltered(content_type) )
out << R("</nofilter>");
}
@@ -476,7 +485,10 @@ void item_admin_meta_tab_has_next(Info & i)
}
void item_can_content_be_html_filtered(Info & i)
{
i.res = cur->request->item.CanContentBeHtmlFiltered();
}