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 | Owned by: | 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)
Change History (10)
#2
@
15 years ago
Cross-reference: http://trac.buddypress.org/ticket/979#comment:6
Not sure if this filter still exists in WP 3.0.
#3
@
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.
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.