Welcome Guest, Not a member yet? Register   Sign In
Escaping issue with my code and/or database?
#1

[eluser]err403_love[/eluser]
I've just started using CI a few days ago and have already managed to create a fairly robust database driven webapp, at least considering how new I am. Smile

So for my very first CI problem (how exciting!):

Inputting the title "X&Y" into my database results in "X&Y;".

If I type in "X&YY" it does the same, and I get "X&YY;".

So I managed to figure out that if I have no whitespace on either side of the ampersand, it will always add a semicolon to the end of the string. So, "X & Y" would turn out fine.

Also, if I type "X& amp ;Y" (remove the spaces) into my input field, it adds just fine as well.

So I assume CI tries to escape this by automatically ending a string with a semicolon if it contains an ampersand with no whitespace? How do I stop this behavior? Why isn't just converting ampersands to their HTML entities?

I apologize if this isn't even a CodeIgniter problem, and I do admit it's a pretty noobish question to be asking, but any help would be appreciated. Smile

Thank you.

EDIT: I actually had to jump through a hoop just to get this posting right!!! It was automatically adding the semi-colons to my first examples! To fake it I had to type out the HTML entities myself!

EDIT2: Try typing it out for yourself! I just had to edit this post 10 times to get it displaying correctly.

EDIT3: I guess this is now officially a bug report. CI should not be doing this to input.


Messages In This Thread
Escaping issue with my code and/or database? - by El Forum - 05-12-2008, 06:21 PM
Escaping issue with my code and/or database? - by El Forum - 05-12-2008, 09:41 PM
Escaping issue with my code and/or database? - by El Forum - 05-12-2008, 10:44 PM
Escaping issue with my code and/or database? - by El Forum - 05-12-2008, 11:04 PM
Escaping issue with my code and/or database? - by El Forum - 05-13-2008, 06:29 AM



Theme © iAndrew 2016 - Forum software by © MyBB