开发者

How to safely save user inputed code to the database

开发者 https://www.devze.com 2023-02-01 02:51 出处:网络
I have section on my site where users can submit code. I want to safely store to the database. I am using php. I tried using html purifier to save data to the database, but it removes all the code.

I have section on my site where users can submit code. I want to safely store to the database.

I am using php. I tried using html purifier to save data to the database, but it removes all the code.

I appreciate any help.

开发者_StackOverflow中文版Thanks.


When you save to the database using cakephp's save method, you are automatically protected from SQL injection.

Useful Link:

http://nuts-and-bolts-of-cakephp.com/2009/08/06/save-now-sanitize-later/

0

精彩评论

暂无评论...
验证码 换一张
取 消