Welcome Guest, Not a member yet? Register   Sign In
POST and validation
#1

[eluser]RS71[/eluser]
Hello

I've reached a certain level of complexity in my validation due the creation of dynamic field groups and I had a question regarding POST values and validation:

I need to alter the keys of an array for my validation to work correctly.
(they go like 0,2,3,7, etc but I need them to be 0,1,2,3,etc)

Now my question is, if I alter the post value before using in validation, will I have any problems?

For example:

Code:
//retrieve the original post array
$array_fix = $this->input->post('array');

//do array fixing here and set to $array_fix again
if ( $this->input->post('array') ) {
   $count = 0;
   foreach ($this->input->post('array') as $key => $value) {
      $array_fix[$count++] = $value;
   }
}

//set the original array POST value to be the newly fixed one
$_POST['array'] = $array_fix;


//use the post value normally/do validation as usual using $this->input->post('array'), etc

Would this cause be problems with security filtering (XSS?) or whatever is used? Also, what type of security measures should I have? When should I use XSS and all that?

Thank you,
RS71




Theme © iAndrew 2016 - Forum software by © MyBB