关于 Kohana prepared statement documentation它指出
Although all parameters are escaped to prevent SQL injection, it is still a good idea to validate/sanitize your input.
根据我对准备好的语句的阅读,我的印象是绑定(bind)参数可以防止 SQL 注入(inject)。如果不是这种情况,在绑定(bind)变量之前我应该使用什么清理/转义方法?
最佳答案
我认为当他们说“验证/清理仍然是一个好主意”时,他们的意思是使用 Valid 类或/和 Validation 类......以确保您将正确的数据插入到您的数据库中。
有关 Kohana 验证的更多信息:http://kohanaframework.org/3.2/guide/kohana/security/validation
更新:
您还应该查看 XSS:http://kohanaframework.org/3.2/guide/kohana/security/xss
关于php - Kohana SQL 准备语句安全,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7772698/