Welcome Guest, Not a member yet? Register   Sign In
form helper and htmlspecialchars
#1

[eluser]Eric Cope[/eluser]
On appoximately line 625 of form_helper.php
Code:
$str = htmlspecialchars($str);
$str = str_replace(array("'", '"'), array("'", """), $str);
My problem is that this tries to replace the &'s inserted by str_replace the next time I cycle through the strings. I replaced these two lines with
Code:
$str = htmlspecialchars(htmlspecialchars_decode($str,ENT_QUOTES),ENT_QUOTES);
This prevents recursive replacements (continually replacing that &'s generated). Can any one comment why this is coded this way in CI?
What are the implications of my change?
#2

[eluser]Eric Cope[/eluser]
My current work around is to leave the helper file alone and
Code:
htmlspecialchars_decode($str,ENT_QUOTES);
the POST data before I place it in the database. Thoughts?
#3

[eluser]snifty[/eluser]
Bump...




Theme © iAndrew 2016 - Forum software by © MyBB