Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/10/2010 09:55:51 PM (17 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-forums/bp-forums-filters.php

    r2198 r2288  
    55add_filter( 'bp_forums_bbconfig_location', 'attribute_escape', 1 );
    66
    7 add_filter( 'bp_get_the_topic_title', 'wp_filter_kses', 1 );
    8 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'wp_filter_kses', 1 );
    9 add_filter( 'bp_get_the_topic_post_content', 'wp_filter_kses', 1 );
    10 
    11 add_filter( 'bp_get_the_topic_title', 'attribute_escape' );
    12 add_filter( 'bp_get_the_topic_post_content', 'attribute_escape' );
     7add_filter( 'bp_get_the_topic_title', 'bp_forums_filter_kses', 1 );
     8add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_filter_kses', 1 );
     9add_filter( 'bp_get_the_topic_post_content', 'bp_forums_filter_kses', 1 );
    1310
    1411add_filter( 'bp_get_the_topic_title', 'wptexturize' );
     
    3835add_filter( 'bp_get_forum_topic_count', 'number_format' );
    3936
    40 function bp_forums_add_allowed_tags( $allowedtags ) {
    41         $allowedtags['p'] = array();
    42         $allowedtags['br'] = array();
     37function bp_forums_filter_kses( $content ) {
     38        global $allowedtags;
    4339
    44         return $allowedtags;
     40        $forums_allowedtags = $allowedtags;
     41        $forums_allowedtags['span'] = array();
     42        $forums_allowedtags['span']['class'] = array();
     43        $forums_allowedtags['div'] = array();
     44        $forums_allowedtags['div']['class'] = array();
     45        $forums_allowedtags['div']['id'] = array();
     46        $forums_allowedtags['a']['class'] = array();
     47        $forums_allowedtags['img'] = array();
     48        $forums_allowedtags['br'] = array();
     49        $forums_allowedtags['p'] = array();
     50        $forums_allowedtags['img']['src'] = array();
     51        $forums_allowedtags['img']['alt'] = array();
     52        $forums_allowedtags['img']['class'] = array();
     53        $forums_allowedtags['img']['width'] = array();
     54        $forums_allowedtags['img']['height'] = array();
     55        $forums_allowedtags['img']['class'] = array();
     56        $forums_allowedtags['img']['id'] = array();
     57        $forums_allowedtags['code'] = array();
     58        $forums_allowedtags['blockquote'] = array();
     59
     60        $forums_allowedtags = apply_filters( 'bp_forums_allowed_tags', $forums_allowedtags );
     61        return wp_kses( $content, $forums_allowedtags );
    4562}
    46 add_filter( 'edit_allowedtags', 'bp_forums_add_allowed_tags' );
    4763
    4864function bp_forums_filter_tag_link( $link, $tag, $page, $context ) {
Note: See TracChangeset for help on using the changeset viewer.