Make WordPress Core

Opened 14 years ago

Closed 12 years ago

#15549 closed defect (bug) (duplicate)

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

Reported by: unpix's profile unpix Owned by: markjaquith's profile 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 12 years ago.

Download all attachments as: .zip

Change History (6)

#1 @markjaquith
14 years ago

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

#2 @PeteMall
14 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

#3 @markjaquith
14 years ago

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

To be clear, this is a Pingback issue.

#4 @wonderboymusic
12 years 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.

#5 @wonderboymusic
12 years 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.