• Resolved watersedge

    (@watersedge)


    Good morning all, I have run into the following problem: When I go to post an email using wp-mail.php, it seems like quotations (single quotes for sure) are not escaped in the body of the email. I get an SQL syntax error “near ‘t know what I will do”.

    Anyone else run into this problem?

Viewing 10 replies - 1 through 10 (of 10 total)
  • I’ve been working around the single quote issue for quite a while now. There doesn’t seem to be much on the forums on a fix, just the “\” work-around.

    I would love to see a fix for this issue, and a category problem I’ve been experiencing for about the same period of time/ All posts are placed in “uncategorized” no matter what box I check. No error messages reported, just no category. Both the single quaotes and category problems have been affecting my site since the beginning of April.

    wp-mail.php ought to include addslashes() to properly escape quotes from the body text of the email. It does not currently do this.

    Spinningmud,

    You may have already tried this, but I once had a similar problem with the categories and found that deleting then recreating them resolved the issue for me. Fortunately I was still new to WP and had under 100 postings so it wasn’t as painful as it could have been. You might try deleting just one and re-creating to see if that’s it. Hope this helps.

    Thread Starter watersedge

    (@watersedge)

    Has this always been an issue with WP (since mail posting has existed)? I find it hard to believe that what seems to be a trivially simple fix (since the escaping is already done during regular posts) hasn’t been fixed yet…

    Servant,
    I’m going to try you suggestion. I have a pile of categories and posts, but it’s worth a try.

    watersedge: Off hand, I don’t know if this has always been a problem. I’ve only recently started helping troubleshoot post-by-email. I don’t do it, myself. Several blog by email solutions exist. If you find one to be superior, please let us know.

    Deleting categories did nothing for me. I still can’t get the category to show up with the post.

    Thread Starter watersedge

    (@watersedge)

    Thanks. I’ll take a look.

    Thread Starter watersedge

    (@watersedge)

    Well, for those of you who came here with the same problem, here’s what i did:

    Open wp-mail.php and change the following lines:

    $subject = trim(str_replace(get_settings('subjectprefix'), '', $subject));

    and

    $content = trim($content);

    to

    $subject = addslashes(trim(str_replace(get_settings('subjectprefix'), '', $subject)));

    and

    $content = addslashes(trim($content));

    Respectively.

    What watersedge proposed here worked perfectly for me. Thanks!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Email body quotes not escaped’ is closed to new replies.