Skip to:

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: Priority: normal
Severity: normal Version:
Component: Back-end Keywords:


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());
	case 'text_direction':
		global $bb_locale;
		$r = $bb_locale->text_direction;
	case 'version' :
		return ''; // Don't filter
	case 'bb_db_version' :
		return '1467'; // Don't filter
	case 'html_type' :
		$r = 'text/html';
	case 'charset' :
		$r = 'UTF-8';
	case 'url' :
		$option = 'uri';
	case 'bb_table_prefix' :
	case 'table_prefix' :
		global $bbdb;
		return $bbdb->prefix; // Don't filter;

it should read:

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

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
  • Version deleted
Note: See TracTickets for help on using tickets.