Opened 8 years ago
Closed 7 years ago
#7448 closed defect (bug) (fixed)
Trailing slash needed for URLs for compatibility with LiteSpeed
Reported by: | allianse | Owned by: | r-a-y |
---|---|---|---|
Milestone: | 2.9 | Priority: | normal |
Severity: | normal | Version: | 2.8.0 |
Component: | Core | Keywords: | has-patch |
Cc: | support@… |
Description (last modified by )
There is a problem for accept a friend with Bosstheme and LiteSpeed Web Server
Please find the file attached with modified lines:
/**
* ORIGINAL SCRIPT
*/
//return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/accept/' . $friendship_id, 'friends_accept_friendship' ), $friendship_id );
/**
* UPDATED SCRIPT (23-FEB-2017)
* To avoid the Accept request URL issue
*/
return apply_filters( 'bp_get_friend_accept_request_link', wp_nonce_url( bp_loggedin_user_domain() . bp_get_friends_slug() . '/requests/accept/' . $friendship_id.'/', 'friends_accept_friendship' ), $friendship_id );
Please modify the file before release next update
Regards
Attachments (3)
Change History (13)
#3
@
8 years ago
- Keywords has-patch added
- Milestone changed from 2.8.2 to 2.9
Hi,
Thanks for the report. It looks like you added a trailing slash to the end of the accept friendship URL.
Since this behavior isn't a regression from a change we made in v2.8.0, this fix will have to wait until v2.9.0.
In the meantime, you can fix this without touching core code by adding the following to your theme's functions.php
or wp-content/plugins/bp-custom.php:
add_filter( 'bp_get_friend_accept_request_link', 'trailingslashit' );
add_filter( 'bp_get_friend_reject_request_link', 'trailingslashit' );
It might also be possible to address this in your config for LiteSpeed to add a trailingslash to all URLs.
Devs: This might be a good chance to audit all other similar links.
#7449 was marked as a duplicate.
#4
@
8 years ago
- Summary changed from buddypress/bp-friends/bp-friends-template.php to Trailing slash needed for URLs for compatibility with LiteSpeed
#5
@
7 years ago
- Component changed from Friends to Core
I've audited all our template link functions to add a trailing slash where necessary.
Question: We use a mis-mash of either trailingslashit()
vs. simply adding a /
to the end of a link. Which one do we prefer?
In 02.patch
, I've opted to use trailingslashit()
, but let me know if you have any issue with this.
This ticket was mentioned in Slack in #buddypress by r-a-y. View the logs.
7 years ago
#7
@
7 years ago
I think this should patch should use user_trailingslashit()
, which does the trailing slash based on the permalink rules.
#9
@
7 years ago
I think this should patch should use user_trailingslashit(), which does the trailing slash based on the permalink rules.
user_trailingslashit()
would make sense if we supported rewrite rules.
I think when we ever get to rewrite rules, we can switch everything to use user_trailingslashit()
, until then perhaps we can stick with trailingslashit()
.
bp-friends-template.php