Skip to:

Opened 12 years ago

Closed 8 years ago

#4715 closed enhancement (wontfix)

Improved sanitization filters for group forum posts

Reported by: chouf1's profile chouf1 Owned by:
Milestone: Priority: low
Severity: minor Version:
Component: Forums Keywords:


When using syntaxhighlighter, they're several output problems.

I changed the filter option in bp-forums-template.php

function bp_the_topic_post_content() {
	echo bp_get_the_topic_post_content();
	function bp_get_the_topic_post_content() {
		global $topic_template;

		//return apply_filters( 'bp_get_the_topic_post_content', stripslashes( $topic_template->post->post_text ) );
		return apply_filters( 'bp_get_the_topic_post_content', wp_specialchars_decode( $topic_template->post->post_text, ENT_QUOTES ) );

Can you add this to the next update ?

To complete for my need, i also added this to functions.php
remove_filter( 'bp_get_the_topic_post_content', 'bp_forums_filter_kses', 1 );
remove_filter( 'bp_get_the_topic_post_content', 'wptexturize' );

Change History (7)

#1 @DJPaul
12 years ago

  • Keywords reporter-feedback added

Hi chouf1: what's the actual problem, and how can we recreate it?

#2 @chouf1
11 years ago

Syntax highlighting is not working correctly, especially for single quotes and ≶, because of the filter in bp-forums-template.php

See the code above, i commented the original filter using strpslashes and put my own below, with specialchar_decode ENT_QUOTES

I asked if it is possible to use my filter.

To get SH fully working, i remove also 2 filters (at my own risk of course)

In fact, there is nothing to reproduce, but only to enhance.

As you know the support forum has some trouble with quotes, too
On the CODEX, alex's synthaxhighlighter is installed,or a similar plugin. If you use it on the support forum, you would probably use the suggested filter instead of the actual BP filter.

I'm using syntaxhighlighter evolved, a fork of alex's one, on a bp-default install, if you need/want absolutly reproduce something.

#3 @boonebgorges
11 years ago

  • Component changed from Core to Forums
  • Keywords has-patch needs-unit-tests added
  • Milestone changed from Awaiting Review to Future Release
  • Priority changed from normal to low
  • Severity changed from normal to minor
  • Summary changed from filter option in group forum post to Improved sanitization filters for group forum posts
  • Type changed from defect (bug) to enhancement

This is the kind of thing we really need test coverage for before we change it.

#4 @chouf1
11 years ago

Hi all,
glad to receive a answer here.:D
By a big hazard, I just updated my BP 1.6.4 with the new SH 3.1.4 plugin. Unfortunatly, it isn't working better and i already use my old hack above to get correct output. It's ok for me so far.
here's an example:

I also installed this SH version on a BP 1.7 beta with group and sitewide forum and bbP2.2.4 enabled. On this config (and bp-default), the result is absolutly wrong, on group and on sw forum !
Of course, i also tried to apply sus-mentionned hack but this had no effect at all. Not searched for a solution at this time.

I (danbpfr) put several post on the plugin support. The lattest just yet:

Last edited 11 years ago by chouf1 (previous) (diff)

#6 @DJPaul
11 years ago

  • Keywords reporter-feedback has-patch needs-unit-tests removed

#7 @r-a-y
8 years ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

We do not support the legacy forums component any more.

Note: See TracTickets for help on using tickets.