Welcome Guest, Not a member yet? Register   Sign In
Validating foreign languages using form validation
#1

[eluser]capypara[/eluser]
Hi all. I have these for my rules in form_validation.php

trim|required|max_length[30]|xss_clean|alpha_dash

I do not want the users to enter any potentially harmful characters so i set the alpha_dash rule. However, all non-English characters ended up being regarded as harmful characters as well. How can i allow the user to enter any non-English character and still prevent stuff like /*-%&#" from being entered?
#2

[eluser]CroNiX[/eluser]
You would have to make new rules that allowed them.
#3

[eluser]@robertotra[/eluser]
When using a framework, often people forget that it is built upon an underlying language: if you do not find what you need inside CI then look into PHP itself:

PHP: Sanitize filters - Manual
http://php.net/manual/en/filter.filters.sanitize.php

Cheers
Roberto




Theme © iAndrew 2016 - Forum software by © MyBB