Skip to:
Content

bbPress.org

Changeset 3769


Ignore:
Timestamp:
02/27/2012 03:53:21 AM (14 years ago)
Author:
johnjamesjacoby
Message:

Remove filters and tags from subscription emails.

  • Remove all filters and strip tags
  • Move needless processing from within the foreach loop
  • Prevents HTML entities from being added
  • Fixes #1700
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/plugin/bbp-includes/bbp-common-functions.php

    r3764 r3769  
    11471147    do_action( 'bbp_pre_notify_subscribers', $reply_id, $topic_id, $user_ids );
    11481148
     1149    // Remove filters from reply content and topic title to prevent content
     1150    // from being encoded with HTML entities, wrapped in paragraph tags, etc...
     1151    remove_all_filters( 'bbp_get_reply_content' );
     1152    remove_all_filters( 'bbp_get_topic_title'   );
     1153
     1154    // Strip tags from text
     1155    $topic_title   = strip_tags( bbp_get_topic_title( $topic_id ) );
     1156    $reply_content = strip_tags( bbp_get_reply_content( $reply_id ) );
     1157    $reply_url     = bbp_get_reply_url( $reply_id );
     1158    $blog_name     = get_option( 'blogname' );
     1159
    11491160    // Loop through users
    11501161    foreach ( (array) $user_ids as $user_id ) {
     
    11551166
    11561167        // For plugins to filter messages per reply/topic/user
    1157         $message = __( "%1\$s wrote:\n\n%2\$s\n\nPost Link: %3\$s\n\nYou are recieving this email because you subscribed to it. Login and visit the topic to unsubscribe from these emails.", 'bbpress' );
    1158         $message = apply_filters( 'bbp_subscription_mail_message', sprintf( $message, $reply_author_name, strip_tags( bbp_get_reply_content( $reply_id ) ), bbp_get_reply_url( $reply_id ) ), $reply_id, $topic_id, $user_id );
     1168        $message = sprintf( __( '%1$s wrote:
     1169
     1170%2$s
     1171           
     1172Post Link: %3$s
     1173
     1174-----------
     1175
     1176You are recieving this email because you subscribed to a forum topic.
     1177
     1178Login and visit the topic to unsubscribe from these emails.', 'bbpress' ),
     1179               
     1180            $reply_author_name,
     1181            $reply_content,
     1182            $reply_url
     1183        );
     1184
     1185        $message = apply_filters( 'bbp_subscription_mail_message', $message, $reply_id, $topic_id, $user_id );
    11591186        if ( empty( $message ) )
    11601187            continue;
    11611188
    11621189        // For plugins to filter titles per reply/topic/user
    1163         $subject = apply_filters( 'bbp_subscription_mail_title', '[' . get_option( 'blogname' ) . '] ' . bbp_get_topic_title( $topic_id ), $reply_id, $topic_id, $user_id );
     1190        $subject = apply_filters( 'bbp_subscription_mail_title', '[' . $blog_name . '] ' . $topic_title, $reply_id, $topic_id, $user_id );
    11641191        if ( empty( $subject ) )
    11651192            continue;
Note: See TracChangeset for help on using the changeset viewer.