Thread Starter
fanboi
(@fanboi)
anyone?
More specifically Ive noticed If I publish a post that contains the following
Oprah Winfrey’s
I get
Oprah Winfrey”s
and each time I revise and republish it adds another apostrophe.
I saw another old post that seemed to have a similar problem – but I didn’t understand the answer – Looking for idiot-proof assistance. I’m not a programmer.
Thread Starter
fanboi
(@fanboi)
anyone? Bueller? Frye? Is this thing on?
Thread Starter
fanboi
(@fanboi)
SERIOUSLY HELP!!!!!!!!!!!!!!!!!!!!!!!! PLEASE!
Thread Starter
fanboi
(@fanboi)
Each time I edit a post, it doubles the amount of ‘
its driving me crazy
Thread Starter
fanboi
(@fanboi)
I installed the update to 2.7.1 and it fixed the retroactive posts that had been affected, but I still get the problem when I edit a post or add a new one.
Was this ever solved?
I’m having the same problem myself. When saving, the POST content parameter only passes a single apostrophe, but I always get back two. This only occurred after upgrading from 2.6.5 to 2.7.1. Old posts with apostrophes are not affected – only ones created with the new version.
Well, I solved it (for my situation, anyway).
WordPress uses PHP’s addslashes() function to escape quotes before inserting into the database. If magic_quotes_sybase is turned on in your PHP installation (which it was for mine), this means adding another single quote as the escape sequence instead of the backslash, which mysql (and most others) expects.
PHP’s documentation for addslashes() indicates that it’s better to use the DBMS-specific escape function(s), which WordPress is not currently doing (mysql_escape_string() is commented out in wp-db.php because supposedly it is causing other problems).
Hope this proves helpful to somebody.
Scratch that. WordPress is already turning magic_quotes_sybase off (wp-settings.php). So even with it off I’m having this issue. If I bypass addslashes() altogether, I do not get the doubled single quotes, so I know this is the problem source – just don’t know why.
Very weird.
OK, one more post and I’m done. Maybe.
To fix the issue once and for all I had to do the complete opposite of what I originally thought the problem was. Only by commenting out @ini_set('magic_quotes_sybase', 0); in wp-settings.php was I finally able to rid myself of the doubled single quote madness. I checked php.ini and the default is On for magic_quotes_sybase. Go figure – “On” is supposed to cause this problem, not fix it.
I would love it if somebody could tell me why this is. In the meantime, I have a hacked wp-settings.php file.
I’ve posted on my blog how to fix this. It is due to a php.ini setting. If you’re on a shared server you have to jump through a few hoops to fix it, but it’s a guaranteed fix…. the guarantee being that if it doesn’t work, comment me and I’ll work out why not π
how to fix wordpress multiple apostrophe
If you are not on a shared server, then you only need to edit the main copy of php.ini. Otherwise see details on my blog. As long as you have at least ftp access to your server, you should be able to fix it with no core code hacks.
Hope this is useful for you! π