diff -ur wordpress-current/wp-admin/users.php wordpress-working/wp-admin/users.php
old
|
new
|
|
95 | 95 | $message = 'New user registration on your blog ' . get_settings('blogname') . ":\r\n\r\n"; |
96 | 96 | $message .= "Login: $user_login\r\n\r\nE-mail: $user_email"; |
97 | 97 | |
98 | | @mail(get_settings('admin_email'), '[' . get_settings('blogname') . '] New User Registration', $message); |
| 98 | @mail_encoded(get_settings('admin_email'), '[' . get_settings('blogname') . '] New User Registration', $message); |
99 | 99 | header('Location: users.php'); |
100 | 100 | break; |
101 | 101 | |
diff -ur wordpress-current/wp-includes/functions.php wordpress-working/wp-includes/functions.php
old
|
new
|
|
982 | 982 | $notify_message .= get_permalink($comment->comment_post_ID) . '#comments'; |
983 | 983 | |
984 | 984 | if ('' == $comment->comment_author_email || '' == $comment->comment_author) { |
985 | | $from = "From: \"$blogname\" <wordpress@" . $_SERVER['SERVER_NAME'] . '>'; |
| 985 | $from = "\"$blogname\" <wordpress@" . $_SERVER['SERVER_NAME'] . '>'; |
986 | 986 | } else { |
987 | | $from = 'From: "' . $comment->comment_author . "\" <$comment->comment_author_email>"; |
| 987 | $from = '"' . $comment->comment_author . "\" <$comment->comment_author_email>"; |
988 | 988 | } |
989 | 989 | |
990 | | $message_headers = "MIME-Version: 1.0\r\n" |
991 | | . "$from\r\n" |
992 | | . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\r\n"; |
993 | | |
994 | | @mail($user->user_email, $subject, $notify_message, $message_headers); |
| 990 | @mail_encoded($user->user_email, $subject, $notify_message, $from); |
995 | 991 | |
996 | 992 | return true; |
997 | 993 | } |
… |
… |
|
1025 | 1021 | |
1026 | 1022 | $subject = '[' . get_settings('blogname') . '] Please approve: "' .$post->post_title.'"'; |
1027 | 1023 | $admin_email = get_settings("admin_email"); |
1028 | | $from = "From: $admin_email"; |
1029 | | |
1030 | | $message_headers = "MIME-Version: 1.0\r\n" |
1031 | | . "$from\r\n" |
1032 | | . "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\r\n"; |
1033 | 1024 | |
1034 | | @mail($admin_email, $subject, $notify_message, $message_headers); |
| 1025 | @mail_encoded($admin_email, $subject, $notify_message, $admin_email); |
1035 | 1026 | |
1036 | 1027 | return true; |
1037 | 1028 | } |
… |
… |
|
1580 | 1571 | endif; |
1581 | 1572 | } |
1582 | 1573 | |
| 1574 | function mail_encoded($to, $subject, $message, $from=''){ |
| 1575 | |
| 1576 | $charset = get_settings('blog_charset'); |
| 1577 | |
| 1578 | # prepare headers |
| 1579 | |
| 1580 | $message_headers = "MIME-Version: 1.0\r\n"; |
| 1581 | if ($from){ |
| 1582 | $message_headers .= "From: $from\r\n"; |
| 1583 | } |
| 1584 | $message_headers .= "Content-Type: text/plain; charset=\"$charset\"\r\n"; |
| 1585 | |
| 1586 | |
| 1587 | # escape subject |
| 1588 | |
| 1589 | $subject = preg_replace('/([^a-z ])/ie', 'sprintf("=%02x",ord(StripSlashes("\\1")))', $subject); |
| 1590 | $subject = str_replace(' ', '_', $subject); |
| 1591 | $subject = "=?$charset?Q?$subject?="; |
| 1592 | |
| 1593 | |
| 1594 | @mail($to, $subject, $message, $message_headers); |
| 1595 | } |
| 1596 | |
1583 | 1597 | function wp_head() { |
1584 | 1598 | do_action('wp_head', ''); |
1585 | 1599 | } |
diff -ur wordpress-current/wp-login.php wordpress-working/wp-login.php
old
|
new
|
|
216 | 216 | $message .= "Password: $user_pass\r\n"; |
217 | 217 | $message .= 'Login at: ' . get_settings('siteurl') . '/wp-login.php'; |
218 | 218 | |
219 | | $m = mail($user_email, '[' . get_settings('blogname') . "] Your weblog's login/password", $message); |
| 219 | $m = mail_encoded($user_email, '[' . get_settings('blogname') . "] Your weblog's login/password", $message); |
220 | 220 | |
221 | 221 | if ($m == false) { |
222 | 222 | echo '<p>' . __('The e-mail could not be sent.') . "<br />\n"; |
… |
… |
|
226 | 226 | echo '<p>' . sprintf(__("The e-mail was sent successfully to %s's e-mail address."), $user_login) . '<br />'; |
227 | 227 | echo "<a href='wp-login.php' title='" . __('Check your e-mail first, of course') . "'>" . __('Click here to login!') . '</a></p>'; |
228 | 228 | // send a copy of password change notification to the admin |
229 | | mail(get_settings('admin_email'), sprintf(__('[%s] Password Lost/Change'), get_settings('blogname')), sprintf(__('Password Lost and Changed for user: %s'), $user_login)); |
| 229 | mail_encoded(get_settings('admin_email'), sprintf(__('[%s] Password Lost/Change'), get_settings('blogname')), sprintf(__('Password Lost and Changed for user: %s'), $user_login)); |
230 | 230 | die(); |
231 | 231 | } |
232 | 232 | |