WordPress.org

Make WordPress Core

Opened 3 years ago

Closed 20 months ago

#15549 closed defect (bug) (duplicate)

WordPress fails to ping whole url if there's an ampersand

Reported by: unpix Owned by: markjaquith
Milestone: Priority: normal
Severity: normal Version: 3.1
Component: Pings/Trackbacks Keywords:
Focuses: Cc:

Description

I have a custom blog and I noticed a problem with pingbacks from Wordpress blogs. When writing a post in Wordpress, it encodes the "&" properly to

&

html entity.

However, when it tries to ping the url, it uses the url where the ampersands are encoded as html entities. This causes Wordpress to strip out every GET variable after the first one, for example:

URL should be:

http://example.com/index.php?a=b&c=d

but it is

http://example.com/index.php?a=b&amp

So Wordpress misses everything after the first variable in the url and fails to ping the right url.

I can see this from my server logs.

Attachments (1)

new-ping-urls-regex.diff (4.3 KB) - added by wonderboymusic 20 months ago.

Download all attachments as: .zip

Change History (6)

comment:1 markjaquith3 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Owner set to markjaquith
  • Status changed from new to accepted

comment:2 PeteMall3 years ago

  • Summary changed from Wordpress fails to ping whole url if there's an ampersand to WordPress fails to ping whole url if there's an ampersand

comment:3 markjaquith3 years ago

  • Keywords needs-patch added; pingback url &amp ampersand removed

To be clear, this is a Pingback issue.

comment:4 wonderboymusic20 months ago

  • Keywords has-patch added; needs-patch removed

The regex used to extract URLs for pinging is old and odd - I updated it to use this one, which I tend to prefer: http://daringfireball.net/2010/07/improved_regex_for_matching_urls

I also moved it into a function so the regex isn't duped across functions. Patch attached.

comment:5 wonderboymusic20 months ago

  • Keywords has-patch removed
  • Milestone Future Release deleted
  • Resolution set to duplicate
  • Status changed from accepted to closed

Duplicate of #9064.

Note: See TracTickets for help on using tickets.