html code in editors (emacs, ckeditor...) is filtered now for normal users

(root is allowed to use any html code)


git-svn-id: svn://ttmath.org/publicrep/winix/trunk@641 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
2010-08-14 17:56:07 +00:00
parent d9f2e91806
commit ca4e53bb0f
11 changed files with 116 additions and 56 deletions

View File

@@ -24,8 +24,9 @@ app.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
app.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
app.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
app.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
app.o: ../templates/templates.h ../templates/patterncacher.h ../core/item.h
app.o: misc.h ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
app.o: ../core/htmlfilter.h ../templates/templates.h
app.o: ../templates/patterncacher.h ../core/item.h misc.h
app.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
app.o: ../core/log.h ../templates/indexpatterns.h ../core/sessionmanager.h
app.o: compress.h getparser.h httpsimpleparser.h postparser.h cookieparser.h
app.o: postmultiparser.h acceptencodingparser.h acceptbaseparser.h plugin.h
@@ -53,11 +54,12 @@ config.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
config.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
config.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
config.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
config.o: ../templates/templates.h ../templates/patterncacher.h
config.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
config.o: ../core/httpsimpleparser.h ../core/log.h
config.o: ../templates/indexpatterns.h ../templates/localefilter.h
config.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
config.o: ../core/htmlfilter.h ../templates/templates.h
config.o: ../templates/patterncacher.h ../core/item.h misc.h
config.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
config.o: ../core/log.h ../templates/indexpatterns.h
config.o: ../templates/localefilter.h ../core/locale.h ../core/locale.h
config.o: ../core/sessionmanager.h
confparser.o: confparser.h misc.h item.h
db.o: db.h item.h user.h group.h thread.h error.h log.h dircontainer.h
db.o: ugcontainer.h ticket.h misc.h
@@ -113,11 +115,12 @@ plugin.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
plugin.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
plugin.o: ../functions/template.h ../functions/tinymce.h ../functions/uname.h
plugin.o: ../functions/upload.h ../functions/uptime.h ../functions/who.h
plugin.o: ../templates/templates.h ../templates/patterncacher.h
plugin.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
plugin.o: ../core/httpsimpleparser.h ../core/log.h
plugin.o: ../templates/indexpatterns.h ../templates/localefilter.h
plugin.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
plugin.o: ../core/htmlfilter.h ../templates/templates.h
plugin.o: ../templates/patterncacher.h ../core/item.h misc.h
plugin.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
plugin.o: ../core/log.h ../templates/indexpatterns.h
plugin.o: ../templates/localefilter.h ../core/locale.h ../core/locale.h
plugin.o: ../core/sessionmanager.h
plugindata.o: plugindata.h plugin.h pluginmsg.h log.h config.h confparser.h
plugindata.o: htmlfilter.h request.h requesttypes.h session.h item.h error.h
plugindata.o: user.h rebus.h system.h dirs.h dircontainer.h db.h group.h
@@ -142,7 +145,7 @@ plugindata.o: ../functions/funthread.h ../core/thread.h
plugindata.o: ../functions/funticket.h ../core/ticket.h
plugindata.o: ../functions/template.h ../functions/tinymce.h
plugindata.o: ../functions/uname.h ../functions/upload.h
plugindata.o: ../functions/uptime.h ../functions/who.h
plugindata.o: ../functions/uptime.h ../functions/who.h ../core/htmlfilter.h
plugindata.o: ../templates/templates.h ../templates/patterncacher.h
plugindata.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
plugindata.o: ../core/httpsimpleparser.h ../core/log.h
@@ -173,7 +176,7 @@ request.o: ../functions/run.h ../functions/subject.h ../functions/funthread.h
request.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
request.o: ../functions/template.h ../functions/tinymce.h
request.o: ../functions/uname.h ../functions/upload.h ../functions/uptime.h
request.o: ../functions/who.h ../templates/templates.h
request.o: ../functions/who.h ../core/htmlfilter.h ../templates/templates.h
request.o: ../templates/patterncacher.h ../core/item.h misc.h
request.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
request.o: ../core/log.h ../templates/indexpatterns.h
@@ -208,11 +211,12 @@ sessionmanager.o: ../core/thread.h ../functions/funticket.h ../core/ticket.h
sessionmanager.o: ../functions/template.h ../functions/tinymce.h
sessionmanager.o: ../functions/uname.h ../functions/upload.h
sessionmanager.o: ../functions/uptime.h ../functions/who.h
sessionmanager.o: ../templates/templates.h ../templates/patterncacher.h
sessionmanager.o: ../core/item.h misc.h ../templates/ckeditorgetparser.h
sessionmanager.o: ../core/httpsimpleparser.h ../core/log.h
sessionmanager.o: ../templates/indexpatterns.h ../templates/localefilter.h
sessionmanager.o: ../core/locale.h ../core/locale.h ../core/sessionmanager.h
sessionmanager.o: ../core/htmlfilter.h ../templates/templates.h
sessionmanager.o: ../templates/patterncacher.h ../core/item.h misc.h
sessionmanager.o: ../templates/ckeditorgetparser.h ../core/httpsimpleparser.h
sessionmanager.o: ../core/log.h ../templates/indexpatterns.h
sessionmanager.o: ../templates/localefilter.h ../core/locale.h
sessionmanager.o: ../core/locale.h ../core/sessionmanager.h
sessionparser.o: sessionparser.h session.h item.h error.h log.h user.h
sessionparser.o: plugindata.h rebus.h sessioncontainer.h lastcontainer.h
sessionparser.o: users.h ugcontainer.h request.h requesttypes.h config.h

View File

@@ -158,6 +158,9 @@ void Config::AssignValues(bool stdout_is_closed)
password_min_size = Size("password_min_size", 5);
debug_info = Bool("debug_info", false);
editors_html_safe_mode = Bool("editors_html_safe_mode", true);
editors_html_safe_mode_skip_root = Bool("editors_html_safe_mode_skip_root", true);
parser.ListText("plugins", plugin_file);
}

View File

@@ -137,7 +137,6 @@ public:
std::string html_filter_orphans_mode_str;
HTMLFilter::OrphanMode html_filter_orphans_mode;
// the url of a new empty item (if there is not the subject too)
std::string item_url_empty;
@@ -189,9 +188,18 @@ public:
size_t password_min_size;
// prints additional information (in the end of the html page as a commentary)
//
bool debug_info;
// in editors (emacs, ckeditor,...) the html will be filtered and unsafe tags
// will be dropped (script, frame, etc.)
// default: true;
bool editors_html_safe_mode;
// don't filter the html code for root
// default: true
// (if true the html code for root is not filtered)
bool editors_html_safe_mode_skip_root;
/*
*/

View File

@@ -1139,6 +1139,10 @@ bool HTMLFilter::PrintRest()
{
const char * start = pchar;
// in safe mode we do not print the rest html code
if( safe_mode )
return false;
while( *pchar )
++pchar;