summaryrefslogtreecommitdiffstats
path: root/wp-inst/wp-includes/pluggable-functions.php
diff options
context:
space:
mode:
authordonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-11-11 11:27:43 +0000
committerdonncha <donncha@7be80a69-a1ef-0310-a953-fb0f7c49ff36>2005-11-11 11:27:43 +0000
commitb92deb93cf1b425d3b0da113dce719ff3e7af839 (patch)
tree4579958b1d0169cf8d86ad2e55286c7b5be90148 /wp-inst/wp-includes/pluggable-functions.php
parentaa750edffae8aeb649b0b2f15900db988e588de7 (diff)
WP Merge
git-svn-id: http://svn.automattic.com/wordpress-mu/trunk@430 7be80a69-a1ef-0310-a953-fb0f7c49ff36
Diffstat (limited to 'wp-inst/wp-includes/pluggable-functions.php')
-rw-r--r--wp-inst/wp-includes/pluggable-functions.php41
1 files changed, 26 insertions, 15 deletions
diff --git a/wp-inst/wp-includes/pluggable-functions.php b/wp-inst/wp-includes/pluggable-functions.php
index 5f84837..7f211c1 100644
--- a/wp-inst/wp-includes/pluggable-functions.php
+++ b/wp-inst/wp-includes/pluggable-functions.php
@@ -42,16 +42,18 @@ function get_userdata( $user_id ) {
$metavalues = $wpdb->get_results("SELECT meta_key, meta_value FROM $wpdb->usermeta WHERE user_id = '$user_id'");
- foreach ( $metavalues as $meta ) {
- @ $value = unserialize($meta->meta_value);
- if ($value === FALSE)
- $value = $meta->meta_value;
- $user->{$meta->meta_key} = $value;
-
- // We need to set user_level from meta, not row
- if ( $wpdb->prefix . 'user_level' == $meta->meta_key )
- $user->user_level = $meta->meta_value;
- }
+ if ($metavalues) {
+ foreach ( $metavalues as $meta ) {
+ @ $value = unserialize($meta->meta_value);
+ if ($value === FALSE)
+ $value = $meta->meta_value;
+ $user->{$meta->meta_key} = $value;
+
+ // We need to set user_level from meta, not row
+ if ( $wpdb->prefix . 'user_level' == $meta->meta_key )
+ $user->user_level = $meta->meta_value;
+ } // end foreach
+ } //end if
wp_cache_add($user_id, $user, 'users');
wp_cache_add($user->user_login, $user, 'users');
@@ -287,16 +289,25 @@ function wp_notify_postauthor($comment_id, $comment_type='') {
$notify_message .= get_permalink($comment->comment_post_ID) . "#comments\r\n\r\n";
$notify_message .= sprintf( __('To delete this comment, visit: %s'), get_settings('siteurl').'/wp-admin/post.php?action=confirmdeletecomment&p='.$comment->comment_post_ID."&comment=$comment_id" ) . "\r\n";
- if ('' == $comment->comment_author_email || '' == $comment->comment_author) {
- $from = "From: \"$blogname\" <wordpress@" . $_SERVER['SERVER_NAME'] . '>';
- } else {
- $from = 'From: "' . $comment->comment_author . "\" <$comment->comment_author_email>";
- }
+ $admin_email = get_settings('admin_email');
+
+ if ( '' == $comment->comment_author ) {
+ $from = "From: \"$blogname\" <$admin_email>";
+ if ( '' != $comment->comment_author_email )
+ $reply_to = "Reply-To: $comment->comment_author_email";
+ } else {
+ $from = "From: \"$comment->comment_author\" <$admin_email>";
+ if ( '' != $comment->comment_author_email )
+ $reply_to = "Reply-To: \"$comment->comment_author_email\" <$comment->comment_author_email>";
+ }
$message_headers = "MIME-Version: 1.0\n"
. "$from\n"
. "Content-Type: text/plain; charset=\"" . get_settings('blog_charset') . "\"\n";
+ if ( isset($reply_to) )
+ $message_headers .= $reply_to . "\n";
+
$notify_message = apply_filters('comment_notification_text', $notify_message);
$subject = apply_filters('comment_notification_subject', $subject);
$message_headers = apply_filters('comment_notification_headers', $message_headers);