WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 5 months ago

#37160 new defect (bug)

Pingbacks fail on multi-page posts

Reported by: dllh Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Pings/Trackbacks Keywords:
Focuses: Cc:
PR Number:

Description

Repro:

  1. Publish a post to pingback in a subsequent post and assure that the site/post will allow pings.
  2. Create a second post that has multiple pages with a reference to the post created in step 1 in one of the later pages (sample content below).
  3. Publish the second post.

Expected: The pingback will register.

Actual: The pingback doesn't register. If you repeat steps 2 and 3 but move the link to the post created in 1 to the first page, the pingback works. Here's some sample content to demonstrate the issue:

Page One

<!--nextpage-->

Page Two

<!--nextpage-->

Page Three with pingback: http://pleasetest.me/2016/06/23/page-to-ping/

This fails because the pingback code checks the pinging post to confirm that the pung link exists in the content. Since the pung link displays on a subsequent page, it's not displayed on the un-paginated permalink. Thus when the pingback code fetches the pinging link, it doesn't find a link to itself in the content and it discards the pingback. But this is a valid use case and not an instance of spoofing (which I take it is what this check is designed to prevent).

I'm not sure if there's some parameter we could append to the url when we fetch to validate the link in context that might skip the pagination. If so, that might be the simplest fix. I suppose another fix might be to look for verifying pingback in the user agent (which is included in this validation request's UA) and skip pagination if found. That feels kind of brittle, though.

Change History (1)

#1 @ocean90
3 years ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.