Skip to:
Content

bbPress.org

#3181 closed defect (fixed)

Wrong trailing slash on reply link on top of topic page

Reported by: satollo Owned by: espellcaste
Milestone: 2.6 Priority: high
Severity: normal Version: 2.5.14
Component: Component - Replies Keywords: needs-patch
Cc:

Description

On top of topic pages, where the freshness info are added, there is a link wrapping them with an hash to move the reader to the new reply form.

That link is generated on file

wp-content/plugins/bbpress/includes/replies/template.php at lines 495-496:

  if ( 1 >= $reply_page ) {
    $url = trailingslashit( $topic_url ) . $reply_hash;

Adding a slash to a permalink, where the blog permalinks DO NOT end with slash creates a different url which forces the page reload to reply (and a lot of new links scanned by search engines bots).

Since an hash is added (#post-...) there is no need to add a slash.

Thank you, Stefano.

Change History (3)

#1 @johnjamesjacoby
22 months ago

  • Keywords needs-patch added
  • Milestone changed from Awaiting Review to 2.6
  • Owner set to espellcaste
  • Priority changed from normal to high

Probably should use user_trailingslashit() instead.

Might be other places this is needed.

#2 @johnjamesjacoby
22 months ago

In 6745:

URLs: Audit the usage of trailingslashit().

This change ensures that trailing slashes are only used at the end of URLs where they're expected, and avoids adding slashes at the end of URLs when permalinks are configured not to include them.

See #3181.

#3 @johnjamesjacoby
22 months ago

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

I *think* this is everything. Closing as fixed.

Note: See TracTickets for help on using tickets.