Skip to:
Content

BuddyPress.org

Ticket #6592: 6592.decode.patch

File 6592.decode.patch, 1.7 KB (added by r-a-y, 4 years ago)

Updated patch due to feedback from Trac.

  • src/bp-core/bp-core-filters.php

     
    349349add_filter( 'bp_login_redirect', 'bp_core_login_redirect', 10, 3 );
    350350
    351351/**
     352 * Decode HTML entities for plain-text emails.
     353 *
     354 * @since 2.5.0
     355 *
     356 * @param string $retval Current email content.
     357 * @param string $prop   Email property to check against.
     358 */
     359function bp_email_plaintext_entity_decode( $retval, $prop ) {
     360        if ( 'content_plaintext' !== $prop ) {
     361                return $retval;
     362        }
     363
     364        return html_entity_decode( $retval, ENT_QUOTES );
     365}
     366add_filter( 'bp_email_get_property', 'bp_email_plaintext_entity_decode', 10, 2 );
     367
     368/**
    352369 * Replace the generated password in the welcome email with '[User Set]'.
    353370 *
    354371 * On a standard BP installation, users who register themselves also set their
  • src/bp-messages/bp-messages-notifications.php

     
    6060
    6161                $args = array(
    6262                        'tokens' => array(
    63                                 'usermessage' => wp_strip_all_tags( $message ),
    64                                 'message.url' => esc_url( bp_core_get_user_domain( $recipient->user_id ) . bp_get_messages_slug() . '/' ),
     63                                'usermessage' => wp_strip_all_tags( stripslashes( $message ) ),
     64                                'message.url' => esc_url( bp_core_get_user_domain( $recipient->user_id ) . bp_get_messages_slug() . '/view/' . $thread_id . '/' ),
    6565                                'sender.name' => $sender_name,
    66                                 'usersubject' => sanitize_text_field( $subject ),
     66                                'usersubject' => sanitize_text_field( stripslashes( $subject ) ),
    6767                        ),
    6868                );
    6969                bp_send_email( 'messages-unread', $ud, $args );