• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
validation class esaping bug

line 663 in validation.php
return str_replace(array("'", '"', '<', '>'), array("'", "&quot;", '&lt;', '&gt;'), stripslashes($str));

There shouldn't be a stripslashes there right?

Yes why is strip slashes there? If magic quotes is off (as it should be) then stripslashes can create undesireable results.

E.g. if I am writing a message board where user can type code examples, if someone types \" or \' or \\ it shouldn't come back as " or ' or \ if there is an error in the form. This is especially problematic in CI 1.7.0 where strip slashes is applied to $_POST so you don't have access to the original unmodified values that were submitted unless you save them before doing a $this->form_validation->run().

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.