So I’ve recently upgraded an older (4.x) Siimple:Press installation to the latest version (as of yesterday, anyway, 5.6.5), and have noticed that some single and double quotes are being garbled.
Let’s say someone entered a sentence with a nice typographical apostrophe and quotes back on the old 4.x forum, like this:
I’d like it if my “friend” stopped using “quotes” inappropriately.
Well, this at some point went into the database as:
I& #39;d like it if my “friend” stopped using “quotes” inappropriately.
(Except for the space between the ampersand and the #39; bit — pretend it’s not there; I actually had to add that space because otherwise it just displays here on this forum as an apostrophe. Arrgggh)
Okay, fine, so in the older version of Simple:Press it saved the HTML codes for things. No worries, because on the old forum, when I edited this post, it would pop up just fine in the rich text editor. (In case anyone is wondering, the database table wp_sf_posts is set to be utf8_general_ci, and was in the previous version as well.)
After upgrading, it still displays fine in the forum. But now, when I try to edit the exact same post in the visual editor (TinyMCE plugin), it’s running it through a filter and converting it. So now, it shows up in the edit post editor as this:
I& #39;d like it if my “friend” stopped using “quotes” inappropriately.
Oops! and when I click the <> button to reveal the “source code,” it shows that, sure enough, TinyMCE has run it through “htmlspecialchars,” double-converting the ampersands so it’s actually treating the post as if it were:
I'd like it if my “friend” stopped using “quotes” inappropriately.
Uhhhh, thanks TinyMCE, but no thanks.
Why is it doing this now when it worked fine before? Is this a known issue?
Do I have to run some kind of global database search and replace for all these special characters? Thank you!