“escape” characters in Group forum posts
Just did a test. BP is adding escape characters all over the place somewhere in the process. forum posts done in bbPress directly are just fine.
Andy, Burt, Nicola – Does BP do any additional text filtering along the way?
Clarification and more INFO:
Sometimes you feel better when you find the same problem on the test site!
Here’s what’s happening (there too)
When a message or forum post is initially sent (no manual page refresh) BP puts escape characters everywhere. If you manually reload the page (any browser) the messages/posts are reformatted and the characters removed. I guess the good news is my users are noticing as much (only when they submit.
Hey Mike. bp does a whole bunch of filtering before the post is sent to bbpress. About 1/2 dozen wp filters, then some bp filtering then it gets sent to bbpress. There is the bp helper plugin over on the bbpress side that does some more filtering, bbpress gets it finally and stores it. Evidently xmlrpc doesn’t want normal <> type tags so they get stripped out, replaced with  tags instead for the trip to bbpress. To be replaced on the bbpress side with normal <> tags. Evidently we can’t have special chars such as single quotes, double quotes, ampersands and other things making the trip so bp escapes or converts them to something else for the xmlrpc trip.
When these whacky little escaped and converted chars get to bbpress they are just stored.
Viewing a bp created post in bbpress is ugly.
But we’re not in bbpress were in bp where when we send our post from bp to bbpress it gets the post from bbpress unconverts, unfilters and unescapes all that stuff to display as the post we just sent.
During this process the html markup that should be allowed like paragraphs and bold are stripped out somewhere along the line for display in bp even if they have successfully made this round trip unscathed.
Now we’re gonna talk about excerpts which have another filtering process applied to them. No we’re not. No I’m not. If you really care, which I don’t anymore, after 4 hrs of tracking this wp action, filter insanity across two pieces of software and several transport mechanisms then you could:
Comment out line: 741 in bp-core.php bp_create_excerpt()
Comment out line: 41 in bp-forums-filters.php bp_forums_filter_decode()
You get excerpts in group forums and posts in group forums that look normal. You could probably copy these fns and do the approved action/filter thing. You could. I personally take great pleasure in deleting the offending lines at this point.
Oh ya. In my travels for the above, I found the magic little function in bbpress for magic links:
I gladly stole it, copied it over to my favorite php file today ‘bp-forums-filters.php’ renamed it my_damn_make_clickable() and hooked it up to the bp universe with this underneath it:
add_filter( ‘bp_the_topic_post_content’, ‘my_damn_make_clickable’);
We got bbpress magic urls in posts!
You of course would want to put that fn in a little utility plugin that runs in mu-plugins.
That is great! I would imagine I will just make the little plugin myself Thanks Burt!
The above instructions on how to ‘solve’ the whacky chars and format stripping that is going on is just a stopgap solution really. We need to filter the text that goes into a post and that comes out of a post. We need to filter the text coming over and going to bbpress.
We need that. This stuff is in core and we shouldn’t be screwing with it like this. I’m gonna just create a ticket that outlines the problems with text i/o in and around bp, mu and bbpress.
The bbpress side of things needs some additional filtering. When stuff comes thru xmlrpc lots of things are escaped out and they are going directly to the db like that. Bad. Then when they come back out and get sent to bp, bp un-escapes them on this side. That leaves those of us who use bbpress as bbpress with trash in the db from the xmlrpc transport.
Gotta fix that too.
Trent’s got WP schwag! Is it swag, shwag or schwag?
Perhaps I shouldn’t have so gleefully stolen sambauer’s magic clickable url function. I just remembered that I have to go over to bbpress forums and ask his help with some xmlrpc stuff in bbpress.
Maybe he won’t notice (shhhh…)
- The topic ‘“escape” characters in Group forum posts’ is closed to new replies.