PhalconPHP - 确保在数据库中创建记录

时间:2015-08-31 19:02:35

标签: php phalcon

我有一个关于如何创建安全记录创建用户传递的表单数据的问题。是:

$account = new Accounts();
$account->email = $parserData['email'];
$account->password = $parserData['password'];
$account->save();

安全还是我应该自己验证(或以某种方式使用绑定)每个数据?在phalcon的网站上提供参考文献的模型教程中,我无法找到关于sql注入的答案。

2 个答案:

答案 0 :(得分:1)

在核心中阻止了SQL注入,你应该使用哈希密码和(可选)检查是否发送电子邮件'和密码'因为XSS是字符串,我刚才开了一个问题: https://github.com/phalcon/cphalcon/issues/2756

另见: https://docs.phalconphp.com/en/latest/reference/security.html http://phalcontip.com/discussion/24/harden-the-password-hashing https://docs.phalconphp.com/en/latest/reference/crypt.html

答案 1 :(得分:0)

Phalcon uses prepared statements, so you don't need to worry about properly escaping when assigning variables.

相关问题