私は質問が答えられたことを知っていますが、私はCIコアをハッキングしないで同様の方法でそれを行いました。配列は、あなたが好きなパスを含めることができます
$config['csrf_ignore'] = array('api');
:私は私のapplication/config/config.phpファイルに以下を追加しました。上記の例は、 'api'で始まるパスに適用されます。
はその後、私は、次のファイルを追加しました:アプリケーション/コア/ MY_Input.php:
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class MY_Input extends CI_Input
{
function _sanitize_globals()
{
$ignore_csrf = config_item('csrf_ignore');
if (is_array($ignore_csrf) && count($ignore_csrf))
{
global $URI;
$haystack = $URI->uri_string();
foreach($ignore_csrf as $needle)
{
if (strlen($haystack) >= strlen($needle) && substr($haystack, 0, strlen($needle)) == $needle)
{
$this->_enable_csrf = FALSE;
break;
}
}
}
parent::_sanitize_globals();
}
}
/* EOF: MY_Input */
あなたの第2のリンクが壊れている –