Ticket #18923: 18923.diff
| File 18923.diff, 1.2 KB (added by solarissmoke, 19 months ago) |
|---|
-
wp-mail.php
105 105 106 106 // Set the author using the email address (From or Reply-To, the last used) 107 107 // otherwise use the site admin 108 if ( preg_match('/(From|Reply-To): /', $line) ) {108 if ( ! $author_found && preg_match('/^\s*(From|Reply-To): /', $line) ) { 109 109 if ( preg_match('|[a-z0-9_.-]+@[a-z0-9_.-]+(?!.*<)|i', $line, $matches) ) 110 110 $author = $matches[0]; 111 111 else 112 $author = trim($line); 113 $author = sanitize_email($author); 114 if ( is_email($author) ) { 115 echo '<p>' . sprintf(__('Author is %s'), $author) . '</p>'; 116 $userdata = get_user_by('email', $author); 117 if ( empty($userdata) ) { 118 $author_found = false; 119 } else { 112 $author = trim( $line ); 113 $author = sanitize_email( $author ); 114 if ( is_email( $author ) ) { 115 echo '<p>' . sprintf( __( 'Author is %s' ), $author ) . '</p>'; 116 $userdata = get_user_by( 'email', $author ); 117 if ( ! empty( $userdata ) ) { 120 118 $post_author = $userdata->ID; 121 119 $author_found = true; 122 120 } 123 } else {124 $author_found = false;125 121 } 126 122 } 127 123
