Strip From/Reply-To from e-mail before sanitizing in wp-mail.php. Props Bobcat. fixes #5169

git-svn-id: https://develop.svn.wordpress.org/trunk@6217 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2007-10-10 16:46:20 +00:00
parent b467f930fd
commit 93014f5c00

View File

@ -62,8 +62,8 @@ for ($i=1; $i <= $count; $i++) :
// Set the author using the email address (To or Reply-To, the last used) // Set the author using the email address (To or Reply-To, the last used)
// otherwise use the site admin // otherwise use the site admin
if (preg_match('/From: /', $line) | preg_match('/Reply-To: /', $line)) { if ( preg_match('/(From|Reply-To): /', $line) ) {
$author = sanitize_email($line); $author = sanitize_email(preg_replace('/(From|Reply-To): /', '', $line));
if ( is_email($author) ) { if ( is_email($author) ) {
echo "Author = {$author} <p>"; echo "Author = {$author} <p>";
$author = $wpdb->escape($author); $author = $wpdb->escape($author);