Make WordPress Core

Opened 16 years ago

Closed 14 years ago

#15549 closed defect (bug) (duplicate)

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

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

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 14 years ago.

Download all attachments as: .zip

Change History (6)

#1 @markjaquith
16 years ago

  • Milestone Awaiting ReviewFuture Release
  • Owner set to markjaquith
  • Status newaccepted

#2 @PeteMall
16 years ago

  • Summary Wordpress fails to ping whole url if there's an ampersandWordPress fails to ping whole url if there's an ampersand

#3 @markjaquith
16 years ago

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

To be clear, this is a Pingback issue.

#4 @wonderboymusic
14 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
14 years ago

  • Keywords has-patch removed
  • Milestone Future Release
  • Resolutionduplicate
  • Status acceptedclosed

Duplicate of #9064.

Note: See TracTickets for help on using tickets.