post via email in WordPress fix
I’ve finally located the bug where MySQL would choke on emailed weblog postings in WordPress. For future reference, or for others that might have the problem, the problem was:
- the wp-cron.php script was sending unescaped characters to the MySQL database, for example, apostrophes.
- the MySQL database would complain.
- the emailed post would stay in the queue, but since it never got into the MySQL database, it would not get posted.
To fix it, I changed line 155 of wp-mail.php from:
$content = trim($content);
to
$content = addslashes(trim($content));
…the downside to this approach is that only plaintext emails will post in an attractive manner, HTML-formatted emails will probably look very very bad.
~jeff