#3424 closed defect (bug) (fixed)
bbp_get_reply_url() generates incorrect link for a spammed topic
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 2.6.10 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Component - Replies | Keywords: | has-patch |
Cc: |
Description
bbp_get_reply_url()
generates two forms of URLs:
https://example.org/topic/test-topic-1/#post-3456
https://example.org/?post_type=topic&p=1234#post-3456
The first form is used for non-pending posts, and the latter for pending posts. The idea is that only pending posts will have a not-url-rewrite url, that assumption is incorrect.
Topics which are marked as spam, also have a non-url-rewrites url, and as a result the url that this function will generate for those use-cases is the following:
https://example.org/?post_type=topic&p=1234/#post-3456
The trailing slash is incorrectly added, as the logic incorrectly assumes that only pending posts won't have ugly urls.
If view=all
is also present, the URL ends up like this:
https://example.org/?post_type=topic&p=1234%2F&view=all#post-3456
The attached patch swaps this around to use bbp_is_topic_published()
instead of ! bbp_is_topic_pending()
which results in all not-published reply links using ugly links, which I think is correct here.
Should consolidate this pagination code someday 🤔 it's a bit complicated right now 😬