开发者

Codeigniter CSRF question

开发者 https://www.devze.com 2023-04-06 18:55 出处:网络
I\'m just wondering of there is any option where i can turn off CSRF in a specific controller/method. I\'ve got another site that pings my site, but getting blocked because of the CSRF.

I'm just wondering of there is any option where i can turn off CSRF in a specific controller/method. I've got another site that pings my site, but getting blocked because of the CSRF.

开发者_StackOverflowIs there any way i can get around this?


Create a pre_system hook then put the following code inside your hook controller:

if(stripos($_SERVER["REQUEST_URI"],'/controller/function') !== FALSE)
{
    $CFG =& load_class('Config', 'core');
    $CFG->set_item('csrf_protection', FALSE);
}

Reference: http://codeigniter.com/forums/viewreply/869900/

0

精彩评论

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