The CodeIgniter framework itself provides security settings such as protection against XSS and CSRF attacks, and protection against SQL injection attacks.
In the case of a configuration file:
In the application/config/config.php
$config [' encryption_key '] = ';//This must be set to encrypt your own cookie, etc. $config[' cookie_secure ' = true;//set to true/*|----------------- ---------------------------------------------------------| Global XSS filtering globally XSS filter set to true|--------------------------------------------------------------------------| | Determines whether the XSS filter is always active when GET, POST or| COOKIE data is encountered|*/$config [' global_xss_filtering '] = true;//guard against CSRF attack $config[' csrf_protection '] = true;$ config[' csrf_token_name ' = ' mall_tooken '; $config [' csrf_cookie_name '] = ' mall_cookie '; $config [' csrf_expire '] = 7200 ;//Set the appropriate time
Open system/core/input.php
Set the $xss_clean in the Get and post methods to true of course your site is safe if it doesn't matter, it's not set or explicitly set when you call Get or post to take arguments.
The development needs to note:
1. Use
$this->input->get (' name ', true);
Instead of using $_get[' name '];
2. Use
$this->input->post (' name ', true);
Instead of using $_post[' name '];
3. Use the ActiveRecord query statement and try to avoid statements such as Select
http://www.bkjia.com/PHPjc/824652.html www.bkjia.com true http://www.bkjia.com/PHPjc/824652.html techarticle The CodeIgniter framework itself provides security settings such as protection against XSS and CSRF attacks, and protection against SQL injection attacks. In terms of configuration files: in application/config/config.ph ...