Changeset 1606
- Timestamp:
- 07/15/2009 05:08:54 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/bp-forums/bp-forums-filters.php
r1584 r1606 28 28 add_filter( 'bp_get_the_topic_post_content', 'make_clickable' ); 29 29 30 add_filter( 'bp_get_activity_content', 'bp_forums_filter_decode' ); 31 add_filter( 'bp_forums_new_post_text', 'bp_forums_filter_encode' ); 32 33 add_filter( 'bp_get_the_topic_post_content', 'bp_forums_filter_decode' ); 34 add_filter( 'bp_get_the_topic_latest_post_excerpt', 'bp_forums_filter_decode' ); 35 30 36 function bp_forums_add_allowed_tags( $allowedtags ) { 31 37 $allowedtags['p'] = array(); … … 36 42 add_filter( 'edit_allowedtags', 'bp_forums_add_allowed_tags' ); 37 43 44 function 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 51 function 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 38 61 ?>
Note: See TracChangeset
for help on using the changeset viewer.