Welcome Guest, Not a member yet? Register   Sign In
xss_clean and moveing from 2.2 to 3.0
#1

Hello,


I just moved our app from ci 2.2 to 3.0 and we getting errors with forms (registration, login, email/password remainder ), where xss_clean is added to validation, for example:
$this->form_validation->set_rules('email','email','trim|required|valid_email|xss_clean');
the following error is generated on the every form on submit:
"Unable to access an error message corresponding to your field name"
(Probably something easy and obvious but not sure why is this happening, checked upgrading from a previous version and probably i missed something)

regards
mm
Reply
#2

Are you able to create a minimal example that I could run on my computer?

If you removed all the code of your app, while the problem still is reproducable, and then zipped that up, I would run it on my computer and solve the issue.

Thanks.
Reply
#3

You seem to have a custom validation method somewhere in there. It usually starts with "callback_" (you can find more info on callback validation here: http://www.codeigniter.com/userguide3/li...on-methods). If this is not the case, you should look for a MY_Validation.php. Maybe the problem is in there.
Reply
#4

ensure that the input field attribute name = "email" in your HTML form
Reply
#5

Hi,
Thanks for the help. It seems that the problem was that we did not autoload helper 'security'. When we removed xss_clean from validation it works ok. (it looks like in previous ci 2.2 there was no need for it when using validation with xss_clean?). We moved app like 2 days ago and left old autoload.php - from ci 2.2 except drivers - where we added session.
Strange, but it works now.
Thanks for ideas.
regards
mm
Reply
#6

This is explained in the upgrade instructions: https://github.com/bcit-ci/CodeIgniter/b...ation-rule
Reply




Theme © iAndrew 2016 - Forum software by © MyBB