Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter modrobert

    (@modrobert)

    The problem seems to be an escaped apostrophe by esc_attr() in the profile title becomes '
    which makes a preg_replace() later on fail by returning null which causes the reply to disappear. Also there is one sprintf() too much in the code for v6.4.9. I’m not 100% sure about the reason because I have limited debug possibilities in wordpress[.]com on a live weblog.

    Changing the code in ‘includes/functions_quote.php’ like this works:

    255c255
    < $view_profile_text = sprintf(
    ---
    > $view_profile_text = esc_attr(sprintf(
    257,258c257,258
    < esc_attr( sprintf(__( 'View %s\'s profile', 'bbpress'),
    < $user_name))
    ---
    > __( 'View %s\'s profile', 'bbpress'),
    > $user_name)
    272c272
    < $content = preg_replace( '#'.$new_link.'#is', '<span class="bbp-author-name">'.$user_name.'</span>', $content );
    ---
    > $content = preg_replace( '#'.preg_quote( $new_link, '#' ).'#is', '<span class="bbp-author-name">'.$user_name.'</span>', $content );

    I let you decide if there are any security implications of that additional preg_quote(), but it makes it work with esc_attr(), alternately I guess the escaped apostrophe character can be removed from the view profile string.

    • This reply was modified 23 hours, 1 minute ago by modrobert.
    • This reply was modified 23 hours, 1 minute ago by modrobert.
    • This reply was modified 23 hours ago by modrobert.
    • This reply was modified 22 hours, 56 minutes ago by modrobert.
    Thread Starter modrobert

    (@modrobert)

    In case it wasn’t clear in my previous posts, only replies containing quotes (with ‘bsp-quote-title’ div tag) are not visible with “Quotes” enabled in bbp style pack v6.4.9.

    Thread Starter modrobert

    (@modrobert)

    OK, yes, it looks like some filter to escape characters. In my setup using wordpress[.]com it probably generates a PHP error because there is no content at all with “Quotes” enabled without that patch. I noticed an alternative is to edit the reply, select “CODE” view, and change the div tag “bsp-quote-title” to something else, and the reason that shows the reply is because it’s not recognized as “Quote” anymore.

Viewing 3 replies - 1 through 3 (of 3 total)