问题
Unable to access an error message corresponding to your field name Username.(xss_clean)
Unable to access an error message corresponding to your field name Email.(xss_clean)
Unable to access an error message corresponding to your field name Password.(xss_clean)
How to overcome errors corresponding to fields? "Unable to access an error message corresponding to your field"
what is this exactly?
回答1:
Unable to access an error message corresponding to your field name Password.(xss_clean)
"Unable to access an error message corresponding to your field"
what is this exactly?
Seems pretty self-explanatory. You're calling xss_clean
as a validation rule, but there is no corresponding validation message for this.
Let me guess... you kept xss_clean
within your validation rules because that's where it was used in your previous version of CodeIgniter, and you did not read the official CodeIgniter version 3 upgrade notes.
Step 13: Check for usage of the ‘xss_clean’ Form validation rule
A largely unknown rule about XSS cleaning is that it should only be applied to output, as opposed to input data.
We’ve made that mistake ourselves with our automatic and global XSS cleaning feature (see previous step about XSS above), so now in an effort to discourage that practice, we’re also removing ‘xss_clean’ from the officially supported list of form validation rules.
Because the Form Validation library generally validates input data, the ‘xss_clean’ rule simply doesn’t belong in it.
If you really, really need to apply that rule, you should now also load the Security Helper, which contains xss_clean() as a regular function and therefore can be also used as a validation rule.
More info here: forum.codeigniter.com/thread-1192.html
来源:https://stackoverflow.com/questions/45253878/how-to-overcome-xss-clean-error-in-codeigniter