表单提交后获取不完整的POST数据

时间:2012-05-17 20:55:39

标签: codeigniter special-characters nicedit

我一直在研究这个问题好几个小时。 我有一张表格,带有textarea。我使用nicEdit texteditor。它取代了textarea并显示了一个很好的文本编辑器,因为我希望我的用户在其内容中添加一些样式。

我使用codeIgniter(PHP),我使用form_helper来创建表单。我还使用form_validation进行ss-validation和jsery验证cs-validation

当我点击提交时,表单提交看似很好。我这样说是因为我使用fiddler(一个http记录器),我看到我的文本带有正确的html标签,文本编辑器围绕它。

但是当我在视图中获得@_pots数据时,某些部分标记已被删除。

fiddler如何跟踪HTTP调用和提交的表单数据(似乎正确)

Hello SO, <br><br>
<span style="font-weight: bold;">the following line should be bold</span><br><br>
<span style="font-style: italic;">the following line should be italic</span><br><br>
<span style="text-decoration: underline;">the following line should be underlined</span><br>

我的html如何在我的视图和我的print_r结果中查看@_post数据

Hello SO,<br><br>
<span bold;"="">the following line should be bold</span><br><br>
<span italic;"="">the following line should be italic</span><br><br>
<span underline;"="">the following line should be underlined</span><br>

看起来不知何故,当我收回数据时,它会删除style =“font-weight

$ _post是否对特殊字符做了什么?!?!有人经历过类似的问题吗? 非常感谢所有回复。

1 个答案:

答案 0 :(得分:0)

您需要从Codeigniter扩展CI_Security类并注释/删除/修改此行:

/*
if(in_array($_SERVER['REQUEST_URI'],$allowed))
        {
            $evil_attributes = array('on\w*', 'xmlns');
        }
        else
        {
            $evil_attributes = array('on\w*', 'style', 'xmlns');
        }
*/
相关问题