• When I try to blog by email, it works fine, unless I have an unescaped apostrophe. (It works fine if I escape it.) Is there any way to automatically escape the apostrophes in the subject line (which I’ve not tested, actually) and in the subject text?

    I am using the standard 1.5.1.3 wp-mail.php.

    Thanks.

    Raw content:

    i’m so bored

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘m so bored’, ‘get error’, ”, ’23’, ‘publish’, ‘get-error’, ‘op]
    INSERT INTO wp_posts (post_author, post_date, post_date_gmt, post_modified, post_modified_gmt, post_content, post_title, post_excerpt, post_category, post_status, post_name, comment_status, ping_status, post_parent) VALUES (‘1’, ‘2005-07-30 17:10:42’, ‘2005-07-30 21:10:42’, ‘2005-07-30 17:10:42’, ‘2005-07-30 21:10:42’, ‘i’m so bored’, ‘get error’, ”, ’23’, ‘publish’, ‘get-error’, ‘open’, ‘open’, ‘0’)

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 3]
    SELECT category_id FROM wp_post2cat WHERE post_id =

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ‘ 23)’ at line 2]
    INSERT INTO wp_post2cat (post_id, category_id) VALUES (, 23)

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1]
    SELECT post_date FROM wp_posts WHERE ID=

    WordPress database error: [You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near ” at line 1]
    SELECT pinged FROM wp_posts WHERE ID =

Viewing 3 replies - 1 through 3 (of 3 total)
  • wp-mail.php does not call stripslashes() the way it ought to. Several alternatives exist for wp-mail.php which handle this better. Maybe try this one, which also supports Gmail.

    Thread Starter wolfangel

    (@wolfangel)

    I am not using a gmail or other sort of secure account to send to, so this doesn’t look like what I want to try — it finds and posts just fine, as long as there’s no apostrophe. I’m looking for something which will take a sentence like: “I’m tired”, which has an error, and return “I\’m tired”, which doesn’t. Or anything which will accept words with apostrophes in the sent email.

    Wolfangel, I just had this problem with WordPress 1.5.2. It’s very easy to solve.

    Open up wp-mail.php in an editor, and search for the line that reads:

    $post_data = compact( [...] );

    (I’ve removed the stuff in the middle, because it’s irrelevant.)

    Insert before it the following two lines:

    $post_content = addslashes($post_content);
    $post_title = addslashes($post_title);

    David

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Blog-by-email with apostrophes’ is closed to new replies.