Skip to:
Content

bbPress.org


Ignore:
Timestamp:
07/13/2016 03:11:43 PM (9 years ago)
Author:
johnjamesjacoby
Message:

Escape display_name field usages in bbp_get_author_link(). (2.5 branch)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.5/includes/users/template.php

    r5370 r6063  
    16531653
    16541654            // Assemble some link bits
    1655             $link_title = !empty( $r['link_title'] ) ? ' title="' . $r['link_title'] . '"' : '';
    1656             $anonymous  = bbp_is_reply_anonymous( $r['post_id'] );
     1655            $link_title = !empty( $r['link_title'] )
     1656                ? ' title="' . esc_attr( $r['link_title'] ) . '"'
     1657                : '';
     1658
     1659            $anonymous = bbp_is_reply_anonymous( $r['post_id'] );
    16571660
    16581661            // Get avatar
     
    16631666            // Get display name
    16641667            if ( 'name' === $r['type'] || 'both' === $r['type'] ) {
    1665                 $author_links[] = get_the_author_meta( 'display_name', $user_id );
     1668                $author_links[] = esc_html( get_the_author_meta( 'display_name', $user_id ) );
    16661669            }
    16671670
     
    16701673                $author_url = bbp_get_user_profile_url( $user_id );
    16711674                foreach ( $author_links as $link_text ) {
    1672                     $author_link[] = sprintf( '<a href="%1$s"%2$s>%3$s</a>', $author_url, $link_title, $link_text );
     1675                    $author_link[] = sprintf( '<a href="%1$s"%2$s>%3$s</a>', esc_url( $author_url ), $link_title, $link_text );
    16731676                }
    16741677                $author_link = implode( '&nbsp;', $author_link );
Note: See TracChangeset for help on using the changeset viewer.