开发者

Securit risks of serializing from PHP to MySQL?

I'm serialising PHP arrays for storage in a MySQL TEXT field (as you do), and I'm wondering if I need to take any preca开发者_如何学Pythonutions regarding injection attacks (do I need to base64 encode it, for example). Also, can anyone offer a good way of storing an array in a MySQL DB so that a FULLTEXT search will work on it reasonably well? Serialized data might work ok-ish, but it might not. Does anyone have any experience with this?

Thanks,

James


If you use a parameterized query, where you separate your actual SQL code from the content, you do not need to worry about injection.

The default in PHP, as you seem to use, would be using PDO. CHeck the manual pdo::prepare

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜