Change default value of a function parameter

Asked

Viewed 35 times

0

I’m migrating a system made in Codeigniter from version 2 to 3, I’ve done most of the steps that the manual but there’s one of them that I have a question, the step 11, because it says that some functions that made the xss filter have now changed the default, now having to pass a second value like TRUE when you want that post, for example, to be filtered.

But anyway, I’m already doing it like this, I created a My_input file that extends Input and rewrote these functions, like get, post and get_post, only I don’t know the most correct way to do this rewrite, if so:

public function get($index = NULL, $xss_clean = TRUE)
{
    return parent::get($index, $xss_clean);
}

or so:

public function get($index = NULL, $xss_clean = TRUE)
{
    return $this->_fetch_from_array($_GET, $index, $xss_clean);
}

or if there is some other more correct way to do it?

1 answer

0

Codeigniter deprecated the use of the massive xss filter automatically. To do this you must filter each input separately, this way:

 $this->input->post('meuInput',TRUE)
  • Yes, and with that my doubt, not to have to change each input I know I can create a file in application/core extending the core/input and rewrite or add the methods there. So what’s the right way to do it?

Browser other questions tagged

You are not signed in. Login or sign up in order to post.