Is it possible to set $ this-> input-> post (); in coding?

I am writing a library for CI, and I have a method that I call to collect all possible post variables. I would like to somehow use the xss and security classes built into the codeigniter input class.

Is it possible?

Here is a working method without using the CI input class.

private function parse_options() { foreach($_POST as $key => $val) { $options[$key] = $val; } return $options; } 
+4
source share
2 answers

Why not then:

 private function parse_options() { foreach($_POST as $key => $val) { $options[$key] = $this->input->post($key); } return $options; } 
+14
source

After about 8 years ..

The documentation ( https://www.codeigniter.com/user_guide/libraries/input.html ) states:

 $this->input->post(NULL, TRUE); // returns all POST items with XSS filter $this->input->post(NULL, FALSE); // returns all POST items without XSS filter 

The reason we try to do this only bypassing and not bypassing it is to keep things consistent. Most likely.

0
source

Source: https://habr.com/ru/post/1341576/


All Articles