Skip to:
Content

BuddyPress.org

Opened 15 years ago

Closed 14 years ago

#1948 closed enhancement (fixed)

[patch] bp_core_get_root_domain should use get_home_url for better ssl handling, etc

Reported by: junsuijin's profile junsuijin Owned by: djpaul's profile DJPaul
Milestone: 1.5 Priority: major
Severity: Version:
Component: Core Keywords: has-patch, tested, needs-testing
Cc:

Description

bp_core_get_root_domain should use the new get_home_url api ( see http://core.trac.wordpress.org/browser/trunk/wp-includes/link-template.php#L1771 ),since it respects a user's current scheme (http vs https), providing full https support to the admin bar among other things. I've provided a patch that gives one possible way to accomplish this, and have successfully tested it on the WordPress trunk (converted from a 3-blog MU install).

Attachments (4)

bp_core_get_root_domain-get_home_url.patch (726 bytes) - added by junsuijin 15 years ago.
1948.patch (2.8 KB) - added by junsuijin 15 years ago.
adds backwards compatability
1948.2.patch (3.4 KB) - added by junsuijin 15 years ago.
add support for calls to non-existant blog ids
1948.3.patch (3.3 KB) - added by DJPaul 14 years ago.
v1

Download all attachments as: .zip

Change History (10)

#1 @johnjamesjacoby
15 years ago

  • Milestone changed from 1.2 to 1.2.1

Punted to 1.2.1 for now to possibly look for a better https handler.

Rememeber 1.2 will still need to work on 2.9.1 installs.

#2 @r-a-y
15 years ago

Cross-reference: http://trac.buddypress.org/ticket/979#comment:6

Not sure if this filter still exists in WP 3.0.

@junsuijin
15 years ago

adds backwards compatability

#3 @junsuijin
15 years ago

  • Milestone changed from 1.2.2 to 1.3
  • Status changed from new to assigned

I just added a patch that will make this feature backwards compatible.

CASE 0: It works as is.

CASE 1: I tested it by commenting out
{{{ /*if ( function_exists( 'get_home_url' ) )

return get_home_url( $blog_id, $path, $scheme );*/ }}}

near the top of bp-core-wpabstraction.php

CASE 2: Includes changes from CASE 1 in addition to an explicit change in bp-core.php such that it reads
{{{ if ( defined( 'BP_ENABLE_MULTIBLOG' ) )

$domain = bp_core_get_home_url( 3 );

else

$domain = bp_core_get_home_url( 3 ); }}}

Both test cases produced working and expected results (all urls pointed to blogid 3 in CASE 2).

CASE 3: As an afterthought I reproduced CASE 2, but using a blog id I knew to not exist. I have updated the patch to handle such a situation by pointing to the appropriate bp_core_get_root_domain() blog.

This patch could use some more testing on different setups but so far seems good.

@junsuijin
15 years ago

add support for calls to non-existant blog ids

#4 @paulhastings0
14 years ago

  • Component set to Core
  • Summary changed from bp_core_get_root_domain should use get_home_url for better ssl handling, etc to [patch] bp_core_get_root_domain should use get_home_url for better ssl handling, etc

#5 @DJPaul
14 years ago

  • Owner changed from junsuijin to DJPaul

@DJPaul
14 years ago

v1

#6 @djpaul
14 years ago

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

(In [3343]) Add https support to bp_core_get_root_domain(). Fixes #1948.

Note: See TracTickets for help on using tickets.