By braham.p on
Hi
In new Drupal single quote is handled properly . We find one Bug in our project. When a text having single quote is posted , it is saved with two single quotes in database. Example. "This is Braham'text" is saved as "This is Braham''text" and editing again it goes to "This is Braham''''text" . I mean that every time no. of single quotes becomes multiply by 2.
Please guide me to handle. can you tell me name&location of the function that is used to handle special characters in a text before saving in database.
Thanks in advance.
Braham
Comments
I have the same issue
This started suddenly.
I have disabled almost all of my modules, manually cleared the cache on everything. Nothing helps wit hthe duplicating of single quotes.
you can use the addslashes() function of php
hello,
You can use the addslashes() function of php, this function used for the escape the special character of text.
before the data inserted in to table, you can escape the data using this function.
Thanks
Are you using PostgreSQL as
Are you using PostgreSQL as your database? I would think the second quote should be stripped out before ouputing it to HTML, not when saving it to databse.
No i am using MySql. I think
No i am using MySql. I think I found the problem and have my host looking into this now. I noticed that while I have all three settings for magic quotes turned off in my htaccess and my settings,php. When I pull the values for them at runtime two are turned on.
magic_quotes_sybase and magic_quotes_gpc
I am 99% sure this is my problem now. I also found this other post with my issue exactly this morning. Not sure why my searching last night didn;t find it. http://drupal.org/node/159840
Thanks for the help guys, I will post if this is the actual soluition.
I've got same problem
mysql with php.ini having all magic turned off, but single quotes double in every post.
Server says
local master value
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase On On
Do I need to talk to my host?