Skip to:
Content

bbPress.org

Opened 13 years ago

Closed 13 years ago

#1709 closed defect (bug) (fixed)

bbp_redirect_to_field() contains error in conditional statement

Reported by: mesayre's profile mesayre Owned by:
Milestone: 2.1 Priority: normal
Severity: normal Version: 2.0
Component: General - Administration Keywords:
Cc:

Description

This conditional statement, found in bbp-common-template.php, contains an error.

function bbp_redirect_to_field( $redirect_to = '' ) {
	
	// Rejig the $redirect_to
	if ( !isset( $_SERVER['REDIRECT_URL'] ) || ( !$redirect_to = home_url( $_SERVER['REDIRECT_URL'] ) ) )
		$redirect_to = wp_get_referer();

The assignment !$redirect_to = home_url() stomps on the value of $redirect_to and also makes the conditional return TRUE regardless of the content of $redirect_to

Should be:

if ( !isset( $_SERVER['REDIRECT_URL'] ) || ( !$redirect_to == home_url( $_SERVER['REDIRECT_URL'] ) ) )
		$redirect_to = wp_get_referer();

Change History (2)

#1 @cnorris23
13 years ago

  • Milestone changed from Awaiting Review to 2.1

Good catch!

#2 @johnjamesjacoby
13 years ago

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

(In [3656]) Do not stomp the $redirect_to variable in bbp_redirect_to_field(). Props mesayre. Fixes #1709.

Note: See TracTickets for help on using tickets.