Skip to:
Content

bbPress.org

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#1624 closed defect (fixed)

legacy bug in bb_get_options

Reported by: _ck_ Owned by:
Milestone: 0.9.0.7 Priority: normal
Severity: normal Version:
Component: Back-end Keywords:
Cc:

Description

There is a legacy bug in bb_get_options in the 0.9 branch that I just noticed. I doubt it will ever be fixed but I am sharing it on the record for the thousands of people who will be continuing to use 0.9 for years.

check bb-includes\functions.php around line 1464

when 'url' is requested, it tries to properly use 'uri'
HOWEVER, there is a missing break; afterwards, so it falls through and returns the table_prefix instead. Hopefully all legacy plugins/code never does a bb_options('url') or bb_get_options('url')

function bb_get_option( $option ) {
	global $bb;

	switch ( $option ) :
	case 'language':
		$r = str_replace('_', '-', get_locale());
		break;
	case 'text_direction':
		global $bb_locale;
		$r = $bb_locale->text_direction;
		break;
	case 'version' :
		return '0.9.0.6'; // Don't filter
		break;
	case 'bb_db_version' :
		return '1467'; // Don't filter
		break;
	case 'html_type' :
		$r = 'text/html';
		break;
	case 'charset' :
		$r = 'UTF-8';
		break;
	case 'url' :
		$option = 'uri';
	case 'bb_table_prefix' :
	case 'table_prefix' :
		global $bbdb;
		return $bbdb->prefix; // Don't filter;
		break;

it should read:

	case 'url' :
		$option = 'uri';
		break;

So never request 'url' in bbPress options, always request 'uri' instead.

Change History (3)

#1 @johnjamesjacoby
10 years ago

  • Milestone changed from Awaiting Review to 0.9

Confirmed. Incoming fix.

#2 @johnjamesjacoby
10 years ago

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

(In [3486]) Fix bb_get_option() when requesting 'url' Props _ck_. Fixes #1624. (0.9 branch)

#3 @johnjamesjacoby
10 years ago

  • Milestone changed from 0.9 to 0.9.0.7
  • Version 0.9.0.6 deleted
Note: See TracTickets for help on using tickets.