Home > Backend Development > PHP Tutorial > thinkphp-php写的论坛,要怎么保留用户发帖文本的原有样式同时又能防注入呢?

thinkphp-php写的论坛,要怎么保留用户发帖文本的原有样式同时又能防注入呢?

WBOY
Release: 2016-06-02 11:28:29
Original
957 people have browsed it

thinkphpphp

要防注入就不得不对用户输入的文本进行过滤,比如去掉一些标签什么的再存进数据库,但是这样一来再显示用户发帖内容的时候,原有的格式就被破坏了,麻烦各位老手指点应该怎么做。我用的thinkphp框架,还有kindeditor的插件,用I方法获取数据之后,那些什么加粗斜体颜色或者换行空格就都被破坏了。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template