Skip to:
Content

BuddyPress.org

Opened 12 years ago

Closed 12 years ago

#4506 closed defect (bug) (no action required)

shortcodes for code in forum post not working correctly

Reported by: chouf1's profile chouf1 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Groups Keywords:
Cc:

Description

I encounter some shortcodes problems in forum posts. Depends of what kind of allowed tags i use, the output is always incorrect.
The tags "code", "pre" or backsticks allowing normally to insert some html code or other like php.
On BP 1.6.1 PHP is passing but not the html...
When i used syntax highlighter evolved plugin with BP 1.2.x/1.3, both html & php where more or less correct. Since BP 1.5, with or without this plugin, the code is not given correctly.

Please read here some more details:
http://buddypress.org/community/groups/miscellaneous/forum/topic/what-syntaxhighlighter-do-you-use-with-buddypress-1-6-1/

I have also a wrong (even if trivial) on forum post title effect, with »words» between quotes.
http://bp-fr.net/groupes/utilisation-configuration-optimisation-de-buddypress/forum/topic/dans-un-groupe-en-afficher-davantage-affiche-un-0/

Of course this are french quotes, but 2 closing quotes instead of «word». In the same time, the title in the sitewide activity is showing "word". These are english quotes who don't need to be different for open and close tag.

French quotes are also on the group activity.
http://bp-fr.net/groupes/utilisation-configuration-optimisation-de-buddypress/forum/

It's not important for me to see english or french quotes, but it's important IMO to have the same appearance everywhere.

The wptexturize function is probably not compatible with the bp_texturize filter ?
wp-includes/formatting.php

This is a remaining problem and not the first ticket i open about it, especially that this problem had been corrected a long time ago and is back today.

Thank you for your patience and showing about it.

Change History (2)

#1 @chouf1
12 years ago

Found a solution on the Net who works with syntaxhighlighter installed:
Change bp-forums-template.php:1166
Replace
return apply_filters( 'bp_get_the_topic_post_content', stripslashes( $topic_template->post->post_text ) );
by this
return apply_filters( 'bp_get_the_topic_post_content', wp_specialchars_decode( $topic_template->post->post_text, ENT_QUOTES ) );

And in theme's functions.php, add this to have correct < and > output
remove_filter( 'bp_get_the_topic_post_content', 'bp_forums_filter_kses', 1 );
remove_filter( 'bp_get_the_topic_post_content', 'wptexturize' );

#2 @johnjamesjacoby
12 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.