Ticket #2209 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

wp-mail chokes when sender name contains apostrophe, e.g: O'Donahue

Reported by: traderjohn Assigned to: ryan
Priority: normal Milestone:
Component: Administration Version: 2.0
Severity: major Keywords: email apostrophe bg|has-patch bg|needs-testing
Cc: wpbugs@jamietalbot.com

Description

To replicate, forward an email from someone with an Irish name, e.g: O'Donahue, to your email post address. The apostrophe is not escaped, (by inserting an additional apostrophe), so a SQL syntax error occurs:

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 'Donahue=20<

Since wp-mail will choke every time it is run, because it has not yet deleted the offending email, no further email posts are possible.

Attachments

possible fix for O'Donahue problem.diff (0.7 kB) - added by majelbstoat on 01/23/06 15:40:06.
Possible patch, needs testing.

Change History

01/23/06 15:38:55 changed by majelbstoat

  • cc set to wpbugs@jamietalbot.com.
  • keywords changed from email, apostrophe to email apostrophe bg|has-patch bg|needs-testing.
  • milestone set to 2.0.1.

Possible patch uploaded. Simply calls addslashes() on the author's name before it goes to the database call. The patch also changes $tableusers to $wpdb->users (couldn't see a reason why it was still like that) and also removes the ORDER BY ID DESC restriction on the query, which is unnecessary due to LIMIT 1. I don't use post by email so it's untested and put together after a quick examination, but it might do the trick. Needs someone else to have a look at it though.

01/23/06 15:40:06 changed by majelbstoat

  • attachment possible fix for O'Donahue problem.diff added.

Possible patch, needs testing.

01/23/06 23:23:07 changed by ryan

  • owner changed from anonymous to ryan.

01/23/06 23:49:24 changed by ryan

  • status changed from new to closed.
  • resolution set to fixed.

(In [3475]) wp-mail quote escaping fix from majelbstoat. fixes #2209

11/30/06 19:41:49 changed by

  • milestone deleted.

Milestone 2.0.1 deleted