Support » Plugin: GD bbPress Tools » Bug with multiple quotes [found a patch]

  • Resolved Fenix01

    (@fenix01)


    Hi !

    There is a bug when you are trying to quote a post who has been quoted. A normal user can’t quote a post who has been quoted.
    For instance, your post will look like something like that.

    Yohann wrote:

    <div class=”d4p-bbt-quote-title”>Yohann wrote:</div>
    quote level 1 : it works

    Here it’s the test page : http://forum.my-shield.com/topic/example/

    I found out a way to avoid this bad display. This problem is due to security issue because a normal user can’t use html tags.

    I finally made a patch that works with wordpress 3.9.1

    patch for wordpress 3.9.1

    -locate your functions.php file in your active theme directory
    – add this piece of code (it will allow some html tags necessary for the quote functionnality)

    add_action( 'bbp_kses_allowed_tags','bbp_allow_tags',999,1);
    function bbp_allow_tags($input){
    	return array(
        //Url
    		'a' => array(
    			'href'     => array(),
    			'rel'      => array()
    		),
    		// Quotes
    		'blockquote'   => array(
    			'class'     => array()
    		),
    		// Div
    		'div'   => array(
    			'class'     => array()
    		)
    
    	);
    }

    Best regards

    https://wordpress.org/plugins/gd-bbpress-tools/

Viewing 8 replies - 1 through 8 (of 8 total)
  • You are a beautiful person!

    I also added span to this, since some bbPress plugins (like one I’m developing for spoilers) use span tags.

    The other problem is how to fix this retroactively. I’m trying a serialized find-and-replace on > and < to see if that can do it.

    Hi Daniel !

    I don’t understand what is the other problem you are referring to ?
    Could you describe me this problem ?

    The other problem was that all past posts from my users would have stuff like <div> written as <div> in the post text view, so it wouldn’t be interpreted corrected as an HTML tag.

    I was able to use the database find-and-replace feature in BackupBuddy to replace this HTML entities and still maintain proper serialization in the database.

    (The serialization is where many fields of the database contain counted content. <div> is 11 characters, but <div> is 5. If the data isn’t re-serialized, the site would get really weird due to database overlaps and missing data.)

    oh, you’re right that’s pretty annoying … But your method is probably the only way to find and replace html entities :s For count fields, you could try to make an sql request to update each row

    This is the best post I’ve found all day!!! Major props to Fenix01!!

    But I’m still having a problem. I used the above code and got the white screen of death in place of my site. Ugh! Same thing happened earlier today when I tested a similar code snippet to resolve the issue of span tags, mentioned by Daniel.

    The other snippet was designed to be used in the bp-custom.php (plugin file for buddypress custom functions).

    I’m not sure where to look for a solution….somewhere in my theme? Now I’m wondering if I should be contacting the theme author for help. Any thoughts?

    Hi kalico 🙂

    You have probably a syntax error in your functions.php file. This is current to have a white screen of the death with wordpress while editing this file. WordPress considers this file like a core file so any syntax error breaks your website.
    If you have a log file provided by your web host, you can check where is the syntax error. It will display the line and the file where the error has been detected.

    Just the fix I needed, worked perfectly, much appreciated.

    Plugin Author Milan Petrovic

    (@gdragon)

    This issue is fixed in 1.7 version.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Bug with multiple quotes [found a patch]’ is closed to new replies.