CodeIgniter Framework Filters HTML Hazard Codes

  • 2021-06-29 10:43:26
  • OfStack

There are actually several ways CodeIgniter filters HTML danger codes, the most common of which are the following:

1. You can choose to use the htmlspecialchars() method for filtering.

2. You can place $config ['global_in the config.php file under the config folderxss_filtering'] = FALSE;Set to:

$config['global_xss_filtering'] = true;

However, this setting can increase the overhead of the server.So it depends.

3. Can be at $this- > input- > The second parameter in an post such as post ('content') is set to true:

$this->input->post('content' , true);

All three methods above can achieve simple data filtering, depending on the situation.


Related articles: