代码点火器XSS清洁和php $_POST


Code igniter XSS clean and php $_POST

这是我的理解,php将urldecode $_GET$_REQUEST,所以我不需要自己

但似乎CI是rawurldecoding $_POST ($this->input->post()),因为全局XSS过滤。我对此很好;但我需要的数据是urldecoded而不是RAWurldecoded。这意味着我需要将+替换为空格(' ')

  1. 我可以做一个简单的str_replace而不引起问题吗?
  2. 我理解php为$_GET和$_REQUEST做什么吗?(手册上是这么说的)?

如果您愿意,可以通过传递参数来禁用XSS过滤。

$this->input->post('post_name', FALSE); // returns specified POST item without XSS filter
$this->input->post(NULL, FALSE); // returns all POST items without XSS filter