Skip to:
Content

Opened 7 months ago

Closed 7 months ago

#3212 closed defect (fixed)

bbp_get_author_display_name() should not echo display names

Reported by: wpdennis Owned by: johnjamesjacoby
Milestone: 2.6 Priority: high
Severity: normal Version:
Component: Component - Users Keywords: commit
Cc:

Description

bbp_get_author_display_name() calls bbp_current_anonymous_user_data( 'name' ):

<?php
function bbp_get_author_display_name( $post_id = 0 ) {
        ...
        } else {
                $retval = bbp_current_anonymous_user_data( 'name' );
        }

It should call bbp_get_current_anonymous_user_data( 'name' ) instead.

Same in bbp_get_author_email():

<?php
function bbp_get_author_email( $post_id = 0 ) {
        ...

        // Not an edit, so rely on current user cookie data
        } else {
                $retval = bbp_current_anonymous_user_data( 'email' );
        }

I marked this ticket as "high" because it echos the values in the middle of the form destroying the HTML structure.

Change History (3)

#1 @johnjamesjacoby
7 months ago

  • Keywords commit added
  • Milestone changed from Awaiting Review to 2.6
  • Owner set to johnjamesjacoby

#3 @johnjamesjacoby
7 months ago

  • Resolution set to fixed
  • Status changed from new to closed

In 6841:

Users: use returning variant of anonymous data functions (instead of echo'ing)

This change makes sure that anonymous user data (name & url) is not prematurely put out to the page when a topic or reply was authored by an anonymous user.

(See r6741 where email was similarly corrected.)

Props wpdennis. Fixes #3212.

Note: See TracTickets for help on using tickets.