Kohana的Formo模块是否可以阻止CSRF?我还没有看到任何代码(代币等)形成保护形式。那么,Formo中是否有任何内置解决方案,或者我必须自己保护表单?
由于
答案 0 :(得分:0)
Kohana对CSRF保护有基本支持。
检查以下链接:
文档:http://forum.kohanaframework.org/discussion/2052/csrf-helper/p1
论坛:http://kohanaframework.org/3.2/guide/api/Security#token
它基本上意味着您必须使用Security::token();
像这样:
echo Form::hidden('csrf', Security::token());
然后,您可以通过验证检查处理表单的令牌:
$array->rules('csrf', array(
'not_empty' => NULL,
'Security::check' => NULL,
));