Make WordPress Core

Ticket #9913: html_entity_decode_blogname.diff

File html_entity_decode_blogname.diff, 2.7 KB (added by tenpura, 15 years ago)

html_entity_decode when mailing.

  • pluggable.php

     
    977977
    978978        $comment_author_domain = @gethostbyaddr($comment->comment_author_IP);
    979979
    980         $blogname = get_option('blogname');
     980        $blogname = @html_entity_decode(get_option('blogname'), ENT_QUOTES, get_option('blog_charset'));
    981981
    982982        if ( empty( $comment_type ) ) $comment_type = 'comment';
    983983
     
    11031103                'Currently %s comments are waiting for approval. Please visit the moderation panel:', $comments_waiting), number_format_i18n($comments_waiting) ) . "\r\n";
    11041104        $notify_message .= admin_url("edit-comments.php?comment_status=moderated") . "\r\n";
    11051105
    1106         $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), get_option('blogname'), $post->post_title );
     1106        $subject = sprintf( __('[%1$s] Please moderate: "%2$s"'), @html_entity_decode(get_option('blogname'), ENT_QUOTES, get_option('blog_charset')), $post->post_title );
    11071107        $admin_email = get_option('admin_email');
    11081108        $message_headers = '';
    11091109
     
    11301130        // but check to see if it's the admin whose password we're changing, and skip this
    11311131        if ( $user->user_email != get_option('admin_email') ) {
    11321132                $message = sprintf(__('Password Lost and Changed for user: %s'), $user->user_login) . "\r\n";
    1133                 wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), get_option('blogname')), $message);
     1133                wp_mail(get_option('admin_email'), sprintf(__('[%s] Password Lost/Changed'), @html_entity_decode(get_option('blogname'), ENT_QUOTES, get_option('blog_charset'))), $message);
    11341134        }
    11351135}
    11361136endif;
     
    11491149
    11501150        $user_login = stripslashes($user->user_login);
    11511151        $user_email = stripslashes($user->user_email);
     1152        $blogname = @html_entity_decode(get_option('blogname'), ENT_QUOTES, get_option('blog_charset'));
    11521153
    1153         $message  = sprintf(__('New user registration on your blog %s:'), get_option('blogname')) . "\r\n\r\n";
     1154        $message  = sprintf(__('New user registration on your blog %s:'), $blogname) . "\r\n\r\n";
    11541155        $message .= sprintf(__('Username: %s'), $user_login) . "\r\n\r\n";
    11551156        $message .= sprintf(__('E-mail: %s'), $user_email) . "\r\n";
    11561157
    1157         @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), get_option('blogname')), $message);
     1158        @wp_mail(get_option('admin_email'), sprintf(__('[%s] New User Registration'), $blogname), $message);
    11581159
    11591160        if ( empty($plaintext_pass) )
    11601161                return;
     
    11631164        $message .= sprintf(__('Password: %s'), $plaintext_pass) . "\r\n";
    11641165        $message .= wp_login_url() . "\r\n";
    11651166
    1166         wp_mail($user_email, sprintf(__('[%s] Your username and password'), get_option('blogname')), $message);
     1167        wp_mail($user_email, sprintf(__('[%s] Your username and password'), $blogname), $message);
    11671168
    11681169}
    11691170endif;