Sanitize (radio buttons, checkboxes and <option>)

天涯浪子 提交于 2019-12-02 14:59:48

问题


In PHP, does one have to sanitize these types of inputs: radio buttons, checkboxes and <option>? Or do only the inputs where the user can enter arbitrary text have to be sanitized?


回答1:


The form you send to the client does not, in any way, limit what data they can send back.

So, yes, you need to provide sanity checking and suitable escaping for every piece of incoming data.




回答2:


Do you use PDO?

If not you need to sanitize them. Especially for <option>any value'here</option>




回答3:


In addition to the other answers, doing a custom ('hacked') POST/GET is always (easily) possible. You should always check EVERY variable that is customizable



来源:https://stackoverflow.com/questions/6280917/sanitize-radio-buttons-checkboxes-and-option

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!