Welcome Guest, Not a member yet? Register   Sign In
Problem using xss_clean()
#1

[eluser]stormlead[/eluser]
Hi all!
i want to use a form validation in which i just want to check the possible cross site script in the field. for which i am using the function as below
Code:
function username_check($name)
    {
      if($name=='')
      {
       $this->form_validation->set_message('username_check', 'The field can not be blank');
       return FALSE;
      }
      elseif ($this->input->xss_clean($name, TRUE) === FALSE)
      {
    // file failed the XSS test
       $this->form_validation->set_message('username_check', 'The field can not be blank');
       return FALSE;
       }
      else
      {
        return TRUE;
      }
    }
but the field is getting cleaned and i am getting output as

[removed]alert('in');[removed]

i just want to display a error message and not to process the field any further.
Please help me out to solve this ....


Messages In This Thread
Problem using xss_clean() - by El Forum - 10-27-2009, 11:36 PM
Problem using xss_clean() - by El Forum - 10-28-2009, 12:17 AM
Problem using xss_clean() - by El Forum - 10-28-2009, 12:39 AM
Problem using xss_clean() - by El Forum - 10-28-2009, 01:00 AM
Problem using xss_clean() - by El Forum - 10-28-2009, 01:03 AM
Problem using xss_clean() - by El Forum - 10-28-2009, 02:40 AM
Problem using xss_clean() - by El Forum - 10-28-2009, 04:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB