Defect #123

Incomplete URL decoding in item URLs

Added by Anonymous 523 days ago. Updated 401 days ago.

Status:Fixed Start:2009-02-21
Priority:Regression Due date:
Assigned to:- % Done:

0%

Category:IRI Handling
Target version:1.2
Affected Version:

trunk

PHP Version:

5.2.6

mbstring enabled:

Yes

iconv enabled:

Yes

cURL enabled:

Yes

zlib enabled:

Yes


Description

The latest version is mangling the URLs in my Amazon wishlist RSS feed. The URLs in the feed are URL encoded, but they work like that. They also work if properly URL decoded.

The URL returned from get_permalink() looks like it has been partially URL decoded, but '%' characters are left behind.

I'm not actually sure if any URL decoding should be happening.

My test code:

$feed = new SimplePie();
$feed->enable_cache(false);
$feed->set_feed_url('http://xml-us.amznxslt.com/onca/xml?SubscriptionId=1FJCCJ9W5JQJB6WDRM02&ListId=1XUGEGT1GZ7R7&ResponseGroup=ListFull%2CLarge%2CReviews&Style=http%3A%2F%2Fimages.amazon.com%2Fmedia%2Fi3d%2F01%2Famzn-wishlist-xsl-1-0.css%3Fv%3D1.0-0&ListType=WishList&Operation=ListLookup&Service=AWSECommerceService');
$feed->init();

foreach ($feed->get_items() as $item) {
echo $item->get_permalink() . '<br>';
}

Switching back to 1.1.3 gives no problems.

URL from the feed:
http://www.amazon.com/Structures-Things-Dont-Fall-Down/dp/0306812835%3FSubscriptionId%3D1FJCCJ9W5JQJB6WDRM02%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0306812835%26coliid%3DI39NKS3BK8VIGT%26colid%3D1XUGEGT1GZ7R7
Returned from SimplePie Pecan/trunk/1035:
http://www.amazon.com/Structures-Things-Dont-Fall-Down/dp/0306812835%3FSubscriptionId%=1FJCCJ9W5JQJB6WDRM02%&tag%=ws%&linkCode%=xm2%&camp%=2025%&creative%=165953%&creativeASIN%=0306812835%&coliid%=I39NKS3BK8VIGT%&colid%253D1XUGEGT1GZ7R7
Returned from SimplePie 1.1.3:
http://www.amazon.com/Structures-Things-Dont-Fall-Down/dp/0306812835%3FSubscriptionId%3D1FJCCJ9W5JQJB6WDRM02%26tag%3Dws%26linkCode%3Dxm2%26camp%3D2025%26creative%3D165953%26creativeASIN%3D0306812835%26coliid%3DI39NKS3BK8VIGT%26colid%3D1XUGEGT1GZ7R7

Associated revisions

Revision 1052
Added by Geoffrey Sneddon 401 days ago

Remove the % as well when removing pct-encoded, fixes #123.

History

Updated by Ryan McCue 523 days ago

  • Category set to IRI Handling
  • Status changed from Unconfirmed to New
  • Target version set to 19

I can confirm this happens, dunno why. Most likely a change in the IRI/URI/URL (whichever it currently is) class of some sort.

Updated by Geoffrey Sneddon 523 days ago

  • Priority changed from Medium to High
  • Target version changed from 19 to 1.2

This can't be fixed in 1.1.4 when it isn't an issue in 1.1.3.

Updated by Geoffrey Sneddon 523 days ago

So %26 and %3D are getting decoded to %& and %= respectively (whereas if they were decoded to & and = respectively everything would be fine).

Updated by Geoffrey Sneddon 522 days ago

  • Priority changed from High to Regression

Updated by Geoffrey Sneddon 401 days ago

  • Status changed from New to Fixed

Applied in changeset r1052.

Also available in: Atom PDF