Hi, I posted this in a different area of the forum and didn't get any replies, so I'm trying here. Please answer if you can!
I have a class that inherits from mosDBtable, I am using it to store() data which comes from form fields. Everything works fine unless there is an apostrophe entered in the form. In that case, it appears that a backslash is inserted before the apostrophe in the database. So if the user enters "It's" it becomes "It\'s". I understand that this is probably intended as an escape character, but then why is it getting into the database? Shouldn't it just escape out, leaving the apostrophe itself in the database?
My GUESS is as follows:
I suspect that for some reason, the string is being "escaped" twice. So if it starts as "It's", it then becomes "It\'s" which is properly escaped, then "It\\\'s" which is the escaped version of the escaped string, protecting the original backslash as it moves into the database. (So when "It\\\'s" is stored in the database it becomes "It\'s") But I could be wrong about that.
Thanks in advance.
mosDBTable-apostrophes & backslashes?
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Forum rules
- lobos
- Joomla! Apprentice
- Posts: 30
- Joined: Wed Jul 19, 2006 3:33 pm
- Location: Sao Paulo, Brasil
- Contact:
Re: mosDBTable-apostrophes & backslashes?
Respect and honour, sempre isso, the tribal way, the only way.
http://en.wikipedia.org/wiki/Tribes_Vengeance
http://en.wikipedia.org/wiki/Tribes_Vengeance