Skip to:
Content

BuddyPress.org

Changeset 1606


Ignore:
Timestamp:
07/15/2009 05:08:54 PM (15 years ago)
Author:
apeatling
Message:

Fixes #853 props burtadsit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/1.0/bp-forums/bp-forums-filters.php

    r1584 r1606  
    2828add_filter( 'bp_get_the_topic_post_content', 'make_clickable' );
    2929
     30add_filter( 'bp_get_activity_content', 'bp_forums_filter_decode' );
     31add_filter( 'bp_forums_new_post_text', 'bp_forums_filter_encode' );
     32
     33add_filter( 'bp_get_the_topic_post_content', 'bp_forums_filter_decode' );
     34add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_filter_decode' );
     35
    3036function bp_forums_add_allowed_tags( $allowedtags ) {
    3137    $allowedtags['p'] = array();
     
    3642add_filter( 'edit_allowedtags', 'bp_forums_add_allowed_tags' );
    3743
     44function bp_forums_filter_encode( $content ) {
     45    $content = htmlentities( $content, ENT_COMPAT, "UTF-8" );
     46    $content = str_replace( '&', '/amp/', $content );
     47
     48    return $content;
     49}
     50
     51function bp_forums_filter_decode( $content ) {
     52    $content = str_replace( '/amp/', '&', $content );
     53    $content = @html_entity_decode( $content, ENT_COMPAT, "UTF-8" );
     54    $content = str_replace( '[', '<', $content );
     55    $content = str_replace( ']', '>', $content );
     56    $content = stripslashes( wp_filter_kses( $content ) );
     57
     58    return $content;
     59}
     60
    3861?>
Note: See TracChangeset for help on using the changeset viewer.