Skip to:
Content

Opened 17 months ago

Last modified 12 months ago

#4715 new enhancement

Improved sanitization filters for group forum posts

Reported by: chouf1 Owned by:
Milestone: Future Release Priority: low
Severity: minor Version:
Component: Forums Keywords:
Cc:

Description

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 (6)

comment:1 DJPaul16 months ago

  • Keywords reporter-feedback added

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

comment:2 chouf115 months 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 bp.org 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.

comment:3 boonebgorges14 months 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.

comment:4 chouf114 months 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:
http://bp-fr.net/groupes/comment-faire-pour/forum/topic/modifier-la-page-daccueil-de-vos-groupes/

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:
http://wordpress.org/support/topic/314doesnt-work-with-bp-17?replies=1#post-3894997

Last edited 14 months ago by chouf1 (previous) (diff)

comment:6 DJPaul12 months ago

  • Keywords reporter-feedback has-patch needs-unit-tests removed
Note: See TracTickets for help on using tickets.