Kohana login and checkout libraries - overlap?

I met Kohana. I read in the Input Library , which automatically pre-filters GET and POST data for me, and the Validation libary , which helps with filtering and form validation.

Should I use both together? The examples provided in the validation library documentation use an unfiltered array $_POST

instead of $this->input->post()

. It looks like it would be safer for me to link them, but the two sets of documentation don't seem to mention each other, so I don't know if that would be redundant or not.

+2


a source to share


3 answers


Globals $_POST

, $_GET

and are $_COOKIE

pre-cleared if global XSS filtering is enabled (it is enabled by default). This is one of the reasons why your code extends Kohana classes so that household items such as entrance sanitization are taken care of for you. However, they encourage the use of input library methods, so there is no reason not to use them. They can just use $_POST

validation in the examples because they want to explain different libraries that are independent of each other.

Their code for instantiating the validation class should be:



$post = new Validation( $this->input->post() );

      

And yes, be sure to use them together! It all went well together.

+2


a source


Yes, use both of them together.



0


a source


If you check the input library, you will find that if it is enabled (it is by default and can be disabled by changing $config['global_xss_filtering']

up FALSE

in config/config.php

), it changes the value of $_POST

, $_GET

, $_SERVER

and $_COOKIE

, so, regardless of whether get Do you get them through $this->input->get()

or $_GET

, the values ​​will be filtered.

0


a source







All Articles