title: XSS filtering on CodeIgniter form
body: <p>I am currently learning the framework "CodeIgniter". But I have a problem for my Form validation. First, let me show you my view :</p>
  
  <pre><code>&lt;form method="post" action="connexion"&gt;
    &lt;label for="pseudo"&gt;Pseudo : &lt;/label&gt;
    &lt;input type="text" name="pseudo" value="" /&gt;
  
    &lt;label for="mdp"&gt;Mot de passe :&lt;/label&gt;
    &lt;input type="password" name="mdp" value="" /&gt;
  
    &lt;input type="submit" value="Envoyer" /&gt;&lt;/form&gt;
  </code></pre>
  
  <p>My controller : </p>
  
  <pre><code>public function connexion()
  {
      $this-&gt;load-&gt;library('form_validation');
  
      $this-&gt;form_validation-&gt;set_rules('pseudo', '"user name"', 'trim|required|min_length[5]|max_length[52]|alpha_dash|encode_php_tags|xss_clean');
      $this-&gt;form_validation-&gt;set_rules('mdp',    '"password"',       'trim|required|min_length[5]|max_length[52]|alpha_dash|encode_php_tags|xss_clean');
  
      if($this-&gt;form_validation-&gt;run())
      {
          $this-&gt;load-&gt;view('connexion_ok');
      }
      else
      {
          $this-&gt;load-&gt;view('form');
      }
  }
  </code></pre>
  
  <p>When I remove the "xss_clean" filter in my controller in the set_rules(), it works perfectly, the form is valid. If the "xss_clean" is present, it doesn't work, it goes in the else. I don't use special chars in my input, only letters.</p>
  
  <p>In the settings I put this on true : $config['global_xss_filtering'] = TRUE;</p>
  
  <p>I read somewhere the "xss_clean" filter is useless. What else can I use ? Maybe helpers or something else ?
  Thank you</p>