Skip to:
Content

BuddyPress.org

Changeset 2288 for trunk/bp-groups.php


Ignore:
Timestamp:
01/10/2010 09:55:51 PM (16 years ago)
Author:
apeatling
Message:

Fixing escaped allowed HTML in forum posts. Adding mention filters to blog comments and forum posts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups.php

    r2285 r2288  
    20822082        return false;
    20832083
     2084    $post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
     2085    $topic_id = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
     2086
    20842087    if ( $forum_post = bp_forums_insert_post( array( 'post_text' => $post_text, 'topic_id' => $topic_id ) ) ) {
    20852088        $topic = bp_forums_get_topic_details( $topic_id );
    20862089
    20872090        $activity_content = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
    2088         $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $post_text ) ) . '</blockquote>';
     2091        $activity_content .= '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>';
    20892092
    20902093        /* Record this in activity streams */
     
    21112114        return false;
    21122115
     2116    $topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title );
     2117    $topic_text = apply_filters( 'group_forum_topic_text_before_save', $topic_text );
     2118    $topic_tags = apply_filters( 'group_forum_topic_tags_before_save', $topic_tags );
     2119    $forum_id = apply_filters( 'group_forum_topic_forum_id_before_save', $forum_id );
     2120
    21132121    if ( $topic_id = bp_forums_new_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_tags' => $topic_tags, 'forum_id' => $forum_id ) ) ) {
    21142122        $topic = bp_forums_get_topic_details( $topic_id );
    21152123
    21162124        $activity_content = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $bp->loggedin_user->id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
    2117         $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $topic_text ) ) . '</blockquote>';
     2125        $activity_content .= '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>';
    21182126
    21192127        /* Record this in activity streams */
     
    21372145    global $bp;
    21382146
     2147    $topic_title = apply_filters( 'group_forum_topic_title_before_save', $topic_title );
     2148    $topic_text = apply_filters( 'group_forum_topic_text_before_save', $topic_text );
     2149
    21392150    if ( $topic = bp_forums_update_topic( array( 'topic_title' => $topic_title, 'topic_text' => $topic_text, 'topic_id' => $topic_id ) ) ) {
    21402151        /* Update the activity stream item */
     
    21432154
    21442155        $activity_content = sprintf( __( '%s started the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $topic->topic_poster ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'/">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
    2145         $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $topic_text ) ) . '</blockquote>';
     2156        $activity_content .= '<blockquote>' . bp_create_excerpt( $topic_text ) . '</blockquote>';
    21462157
    21472158        /* Record this in activity streams */
     
    21672178    global $bp;
    21682179
     2180    $post_text = apply_filters( 'group_forum_post_text_before_save', $post_text );
     2181    $topic_id = apply_filters( 'group_forum_post_topic_id_before_save', $topic_id );
     2182
    21692183    $post = bp_forums_get_post( $post_id );
    21702184
     
    21772191
    21782192        $activity_content = sprintf( __( '%s posted on the forum topic %s in the group %s:', 'buddypress'), bp_core_get_userlink( $post->poster_id ), '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . 'forum/topic/' . $topic->topic_slug .'">' . attribute_escape( $topic->topic_title ) . '</a>', '<a href="' . bp_get_group_permalink( $bp->groups->current_group ) . '">' . attribute_escape( $bp->groups->current_group->name ) . '</a>' );
    2179         $activity_content .= '<blockquote>' . bp_create_excerpt( attribute_escape( $post_text ) ) . '</blockquote>';
     2193        $activity_content .= '<blockquote>' . bp_create_excerpt( $post_text ) . '</blockquote>';
    21802194
    21812195        /* Record this in activity streams */
Note: See TracChangeset for help on using the changeset viewer.