Welcome Guest, Not a member yet? Register   Sign In
XSS filter problem
#1

[eluser]Jeffrey04[/eluser]
I am not sure whether this is a desired result, but when I have input in the following form

Quote:<script whatever text strings follow >

retrieving the following

Code:
$this->input->post('the_field', TRUE);

will return an empty string but it passes the validation rule 'required'. I tested the following string

Quote:<script some valid search strings
<script asdfjasdklfjasdklfj als>

to search in this forum and I get error for search terms that are too short
#2

[eluser]xwero[/eluser]
what if you add xss in front of the required rule in your validation. The xss in the input->post is a pre validation action that is why the required rule is valid but you get an empty string.
#3

[eluser]Jeffrey04[/eluser]
[quote author="xwero" date="1212751737"]what if you add xss in front of the required rule in your validation. The xss in the input->post is a pre validation action that is why the required rule is valid but you get an empty string.[/quote]

thanks for the information, so this means input->post('...', TRUE) does the xss filtering after going though the defined rules?
#4

[eluser]xwero[/eluser]
Yes if you want it before the validation you can add the xss 'rule' as i suggested or set the the global xss filtering to true




Theme © iAndrew 2016 - Forum software by © MyBB