Skip to:
Content

bbPress.org

Opened 7 months ago

Last modified 7 months ago

#3424 new defect

bbp_get_reply_url() generates incorrect link for a spammed topic

Reported by: dd32 Owned by:
Milestone: Awaiting Review 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.

Attachments (1)

3424.diff (1.3 KB) - added by dd32 7 months ago.

Download all attachments as: .zip

Change History (2)

@dd32
7 months ago

This ticket was mentioned in Slack in #forums by dd32. View the logs.


7 months ago

Note: See TracTickets for help on using tickets.