Skip to content

Commit 852e407

Browse files
committed
wp-mail quote escaping fix from majelbstoat. fixes WordPress#2209
git-svn-id: https://develop.svn.wordpress.org/trunk@3475 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 0176600 commit 852e407

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

wp-mail.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@
6161
if (preg_match('/From: /', $line) | preg_match('Reply-To: /', $line)) {
6262
$author=trim($line);
6363
if ( ereg("([a-zA-Z0-9\_\-\.]+@[\a-zA-z0-9\_\-\.]+)", $author , $regs) ) {
64-
echo "Author = {$regs[1]} <p>";
65-
$result = $wpdb->get_row("SELECT ID FROM $tableusers WHERE user_email='$regs[1]' ORDER BY ID DESC LIMIT 1");
64+
$author = $regs[1];
65+
echo "Author = {$author} <p>";
66+
$author = $wpdb->escape($author);
67+
$result = $wpdb->get_row("SELECT ID FROM $wpdb->users WHERE user_email='$author' LIMIT 1");
6668
if (!$result)
6769
$post_author = 1;
6870
else

0 commit comments

Comments
 (0)