我在本地机器上使用pyrocms,我尝试在post-data中提交一些html到自定义模块控制器。 我使用CKEditor添加一些内容。
我使用jquery.post,只是一些测试:
$('#ticket-form').submit(function(){
console.warn(CKEDITOR.instances.message.getData());
$.post("admin/tickets/playground", { message: CKEDITOR.instances.message.getData() });
return false;
});
我打提交按钮和控制台说:
<span style="font-size:14px;">Test</span>
看起来不错。
在后端侧我的控制器看起来像:
public function playground(){
log_message('error',$_POST['message']);
var_dump($_POST);
}
两个垃圾场的结果是:
<span >Test</span>
没有什么别的我的控制器。没有html剥离等...
pyrocms有一个博客模块,如果我发布博客文章的HTML不会被剥夺。 所以CKEditor的价值很好,我发布的数据也是如此。我不使用XSS等..
输入类自动过滤GET/POST/COOKIE数组。 [Documentation](http://ellislab.com/codeigniter/user-guide/libraries/input.html) – 2013-03-21 13:19:26
它与其他模块(如博客或网页)一起工作,所以似乎有一种方法。 – Jens 2013-03-21 13:22:52