#include <cppcms/application.h>
#include <cppcms/applications_pool.h>
#include <cppcms/service.h>
#include <cppcms/http_response.h>
#include <cppcms/http_request.h>
#include <cppcms/filters.h>
#include <cppcms/xss.h>
#include <cppcms/json.h>
#include <iostream>
public:
{
}
virtual void main(std::string url);
};
void my_xss::main(std::string )
{
std::string text;
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">"
"<html>\n"
"<head><title>XSS Test</title>\n";
if(
settings().
get(
"filters.tinymce",
false)==
true) {
"<script type=\"text/javascript\" src=\"/tinymce/jscripts/tiny_mce/tiny_mce.js\" ></script >\n"
"<script type=\"text/javascript\" >\n"
"tinyMCE.init({ \n"
" mode : \"textareas\",\n"
" plugins : \"autolink\",\n"
" theme : \"simple\" });\n"
"</script>\n";
}
"<body>\n"
" <h1>Test XSS Filters</h1>\n"
"<form method='post' action='/xss'>\n"
"<textarea name='xss' cols='80' rows='25' >"
"</textarea><br>\n"
"<input type='submit' value='Send' />\n"
"</form>\n"
" <table border='1'>\n"
"<tr><td>Original</td><td><code><pre>"
<<"</pre></code></td></tr>\n"
"<tr><td>Filtered</td><td><code><pre>"
<<"</pre></code></td></tr>\n"
"<tr><td>Filtered HTML</td><td>"
<<"</td></tr>\n"
<<"</table>\n"
"</body>\n"
"</html>\n";
};
int main(
int argc,
char ** argv)
{
try {
}
catch(std::exception const &e) {
std::cerr<<e.what()<<std::endl;
}
}