Make WordPress Core

Changeset 35415


Ignore:
Timestamp:
10/28/2015 06:02:41 PM (11 years ago)
Author:
wonderboymusic
Message:

Mail: in wp_notify_postauthor() and wp_notify_moderator(), ensure that special chars aren't HTML-encoded in the email message body.

Props solarissmoke, leemon.
Fixes #12584.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/pluggable.php

    r35365 r35415  
    14581458        // we want to reverse this for the plain text arena of emails.
    14591459        $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
    1460 
     1460        $comment_content = wp_specialchars_decode( $comment->comment_content );
     1461       
    14611462        switch ( $comment->comment_type ) {
    14621463                case 'trackback':
     
    14651466                        $notify_message .= sprintf( __('Website: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
    14661467                        $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
    1467                         $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment->comment_content ) . "\r\n\r\n";
     1468                        $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
    14681469                        $notify_message .= __( 'You can see all trackbacks on this post here:' ) . "\r\n";
    14691470                        /* translators: 1: blog name, 2: post title */
     
    14751476                        $notify_message .= sprintf( __('Website: %1$s (IP: %2$s, %3$s)'), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
    14761477                        $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
    1477                         $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment->comment_content ) . "\r\n\r\n";
     1478                        $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
    14781479                        $notify_message .= __( 'You can see all pingbacks on this post here:' ) . "\r\n";
    14791480                        /* translators: 1: blog name, 2: post title */
     
    14861487                        $notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n";
    14871488                        $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
    1488                         $notify_message .= sprintf( __('Comment: %s' ), "\r\n" . $comment->comment_content ) . "\r\n\r\n";
     1489                        $notify_message .= sprintf( __('Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
    14891490                        $notify_message .= __( 'You can see all comments on this post here:' ) . "\r\n";
    14901491                        /* translators: 1: blog name, 2: post title */
     
    16091610        // we want to reverse this for the plain text arena of emails.
    16101611        $blogname = wp_specialchars_decode(get_option('blogname'), ENT_QUOTES);
     1612        $comment_content = wp_specialchars_decode( $comment->comment_content );
    16111613
    16121614        switch ( $comment->comment_type ) {
     
    16171619                        $notify_message .= sprintf( __( 'Website: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
    16181620                        $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
    1619                         $notify_message .= __('Trackback excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     1621                        $notify_message .= __('Trackback excerpt: ') . "\r\n" . $comment_content . "\r\n\r\n";
    16201622                        break;
    16211623                case 'pingback':
     
    16251627                        $notify_message .= sprintf( __( 'Website: %1$s (IP: %2$s, %3$s)' ), $comment->comment_author, $comment->comment_author_IP, $comment_author_domain ) . "\r\n";
    16261628                        $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
    1627                         $notify_message .= __('Pingback excerpt: ') . "\r\n" . $comment->comment_content . "\r\n\r\n";
     1629                        $notify_message .= __('Pingback excerpt: ') . "\r\n" . $comment_content . "\r\n\r\n";
    16281630                        break;
    16291631                default: // Comments
     
    16331635                        $notify_message .= sprintf( __( 'Email: %s' ), $comment->comment_author_email ) . "\r\n";
    16341636                        $notify_message .= sprintf( __( 'URL: %s' ), $comment->comment_author_url ) . "\r\n";
    1635                         $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment->comment_content ) . "\r\n\r\n";
     1637                        $notify_message .= sprintf( __( 'Comment: %s' ), "\r\n" . $comment_content ) . "\r\n\r\n";
    16361638                        break;
    16371639        }
Note: See TracChangeset for help on using the changeset viewer.