Forum Replies Created

Viewing 4 replies - 1 through 4 (of 4 total)
  • 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.

    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.

    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.

    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.

Viewing 4 replies - 1 through 4 (of 4 total)