Welcome Guest, Not a member yet? Register   Sign In
Ampersands, semi-colons and headaches
#1

[eluser]obobo[/eluser]
I've run into a problem on two CI installations,
and haven't had any luck tracking down the source of the error.

If i put any text that contains an ampersand in the middle of a word into a text field,
a semi-colon is added to the end of the word when i submit the form.

so ....
me&you;becomes me&you;

This happens on every form i'm using
whether i am using CI's validation class or not.

I've tried tracking it down in my model, in my controller and my view with no luck.

UPDATE: actually it just happened here as well when i put the first me&you;above
strange.
now i'm wondering whether this some obvious html or php thing i'm not aware of.
#2

[eluser]Derek Allard[/eluser]
Hey obobo. What you've got is CodeIgniter's security input filtering kicking in. Anything that starts with an & and ends with a ";" can represent a special character. Special characters can be used to inject malicious code into webpages in browsers that improperly treat unclosed specials, so the input library closes anything that it thinks might be a special character.

I know this is a bit of an inconvenience, and we're looking at ways to better implement this, but all current solutions would involve reducing the security and protection that CI offers, and we aren't willing to do that.
#3

[eluser]obobo[/eluser]
Thanks for the info Derek.
i was going a bit loco trying to figure out what was happening Smile
#4

[eluser]missionsix[/eluser]
when your inputing 'me&you;' maybe type: 'me&you' to bypass the filter problem
#5

[eluser]Derek Allard[/eluser]
or spaces around the ampersand & may help.




Theme © iAndrew 2016 - Forum software by © MyBB