Make WordPress Core

Opened 10 years ago

Closed 9 years ago

#31333 closed defect (bug) (fixed)

Comment reply link broken in ajax call

Reported by: aruns6578's profile aruns6578 Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 4.3 Priority: normal
Severity: normal Version: 4.1
Component: Comments Keywords: has-patch
Focuses: Cc:

Description

Will it be okay to change

esc_url( add_query_arg( 'replytocom', $comment->comment_ID ) ) . "#" . $args['respond_id']

to

esc_url( add_query_arg( 'replytocom', $comment->comment_ID, get_permalink($post->ID) ) ) . "#" . $args['respond_id']

at line https://core.trac.wordpress.org/browser/tags/4.1/src/wp-includes/comment-template.php#L1412

The get_comment_reply_link function sends wrong URL when requested via ajax call.

Attachments (1)

31333.1.diff (681 bytes) - added by nazmul.hossain.nihal 10 years ago.
patch for comment-template.php

Download all attachments as: .zip

Change History (10)

@nazmul.hossain.nihal
10 years ago

patch for comment-template.php

#1 @nazmul.hossain.nihal
10 years ago

@aruns6578: I just made a patch using your codes.

#2 @nazmul.hossain.nihal
10 years ago

  • Keywords has-patch added

#3 @SergeyBiryukov
10 years ago

#32277 was marked as a duplicate.

#4 @SergeyBiryukov
10 years ago

  • Milestone changed from Awaiting Review to 4.3

#5 @SergeyBiryukov
10 years ago

This will probably fix #31100 as well.

This ticket was mentioned in Slack in #core by shelob9. View the logs.


10 years ago

#7 @obenland
10 years ago

  • Owner set to SergeyBiryukov
  • Status changed from new to assigned

#9 @wonderboymusic
9 years ago

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

In 32786:

In get_comment_reply_link(), when generating the reply link, add the replytocom query arg to the result of get_permalink() on the current $post, instead of the current global request URI.

Props nazmul.hossain.nihal.
Fixes #31333.

Note: See TracTickets for help on using tickets.