How I got my WPMU 2.7.1 / BuddyPress 1.0 / BBPress Alpha 6 to behave.
-
I’m marking this as ‘not resolved’ because I’m sure there is a better way to do this…and I’m simply astounded that so many people are having issues with this same installation pattern within different environments. It’s really obnoxious.
With that said, I got my setup working using the instructions found here: http://theeasybutton.com/blog/2009/04/30/integrating-buddypress-10-wpmu-and-bbpress/ and downloading the Alpha 6 version of BBPress from the same site, since it’s not available (at least I couldn’t find it) on the BBPress site since their new release of RC-1.
Now, after following these instructions, and I’ve installed several of these again from scratch to make sure I did everything correctly…I was having backslashes appear in my BBPress forum. They were showing up in different cases, here’s a break down:
These cases below are specific to the Topic Name, not the actual content within the post.
- Creating a new topic in BBPress would result in NO slashes appearing on the charcters ‘ ” and (meaning it worked perfectly). On the BuddyPress groups side of things it also rendered correctly. I checked the database and the records contained no slashes as well.
- Creating a new topic on the BuddyPress side (in groups -> forums) showed perfectly on the BuddyPress side. However, on the BBPress side I would see for the following topic title:
"Testing" 'single-quotes' / and stuff!
BuddyPress: "Testing" 'single-quotes' / \ and stuff!
BBPress: \\\"Testing\\\" \\\'single-quotes\\\' / \\\ and stuff!
This was a huge annoyance. I managed to band-aid it with the help of Chris at the Easy Button site I referenced above. You can scroll down and see the back-and-forth in the comments (I’m Jason).
Here’s the fix, and it’s ugly and definitely not the best solution, as it now strips out characters entirely, even ones I’ve intentionally typed in. Go to the directory that contains BBPress->bb-includes->defaults.bb-filters.php
In this file I first changed this chunk of code:
<br />
// Strip, trim, kses, special chars for string saves<br />
$filters = array( 'pre_term_name', 'bb_pre_forum_name', 'pre_topic_title' );<br />
foreach ( $filters as $filter ) {<br />
add_filter( $filter, 'strip_tags' );<br />
add_filter( $filter, 'trim' );<br />
add_filter( $filter, 'bb_filter_kses' );<br />
add_filter( $filter, 'wp_specialchars', 30 );<br />
}<br />to
<br />
$filters = array( 'pre_term_name', 'bb_pre_forum_name', 'pre_topic_title' );<br />
foreach ( $filters as $filter ) {<br />
add_filter( $filter, 'strip_tags' );<br />
add_filter( $filter, 'trim' );<br />
add_filter( $filter, 'bb_filter_kses' );<br />
add_filter( $filter, 'wp_specialchars', 30 );<br />
add_filter( $filter, 'stripslashes' ); // <-- this is the new line I added<br />
}<br />This strips out the slashes for me down to one. So in the above topic title, on the BBPress side, I would now see:
\"Testing\" \'single-quotes\' / \ and stuff!
At this point I was pretty much like WTF…but then I poked around a bit more within the same file and changed this chunk of code:
<br />
// Format Strings for Display<br />
$filters = array( 'get_forum_name', 'topic_title', 'bb_title', 'bb_option_name' );<br />
foreach ( $filters as $filter ) {<br />
add_filter( $filter, 'wp_specialchars' );<br />
}<br />to
<br />
// Format Strings for Display<br />
$filters = array( 'get_forum_name', 'topic_title', 'bb_title', 'bb_option_name' );<br />
foreach ( $filters as $filter ) {<br />
add_filter( $filter, 'wp_specialchars' );<br />
add_filter( $filter, 'stripslashes' ); // <-- this is the new line I added<br />
}<br />I haven’t tested this very deeply but so far it seems to fix my problem, it removed all the slahses…including any I type in purposefully. What worries me is that Chris was only seeing a single slash and just the first chunk of code fixed it for her. We followed the exact same steps for installing.
Here’s some more info in case it’s needed about my PHP / MySQL set up:
I’m using MAMP on Mac OS X. I have it set up to work with my local host, which I reference not by ‘localhost’ but by an IP address. E.G.: http://192.168.1.1/my-site-name
MySQL charset: UTF-8 Unicode (utf8)
MySQL connection collation: utf8_unicode_ci
PHP Version 5.2.6
magic_quotes_gpc On On
magic_quotes_runtime Off Off
magic_quotes_sybase Off Off
- The topic ‘How I got my WPMU 2.7.1 / BuddyPress 1.0 / BBPress Alpha 6 to behave.’ is closed to new replies.