• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Bug in validation library

#7
[eluser]Donny Kurnia[/eluser]
[quote author="onejaguar" date="1222315090"]"prep_for_form" is indeed redundant; it will automatically be run on all fields if a validation error occurs and will not be run in there are no errors, even if explicitly told to run in the rules.

The "form_prep" helper function will do what you want; running in all cases. e.g.:
Code:
$this->load->helper('form');
$rules['data'] = 'trim|xss_clean|form_prep|max_length[255]|required';

Rather than changing functionality, the user manual should be updated to remove “prep_for_form” as an option in the validation rules and it should state that if there are errors, special characters are converted so that HTML data can be shown in a form field without breaking it.[/quote]

I didn't think to use form_prep in the rules. Thanks for the info Smile

I hope the documentation get updated for the next CI release.


Messages In This Thread
Bug in validation library - by El Forum - 08-10-2008, 10:34 PM
Bug in validation library - by El Forum - 08-11-2008, 05:23 AM
Bug in validation library - by El Forum - 08-11-2008, 07:40 AM
Bug in validation library - by El Forum - 08-11-2008, 11:01 PM
Bug in validation library - by El Forum - 08-24-2008, 11:18 PM
Bug in validation library - by El Forum - 09-24-2008, 04:58 PM
Bug in validation library - by El Forum - 09-24-2008, 07:54 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.