Skip Menu |

This queue is for tickets about the Business-PayPal-NVP CPAN distribution.

Report information
The Basics
Id: 41592
Status: resolved
Worked: 30 min
Priority: 0/
Queue: Business-PayPal-NVP

People
Owner: scott [...] mailblock.net
Requestors: BARTL [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.03
Fixed in: (no value)



Subject: Parsing of the server response is buggy
The response of the server can be treated as if it was formdata. However, the parser at the end of sub _do_request is buggy, as far as a form parser is concerned. If any value contains a "=" character (or even any name, which is very unlikely as the output is controlled by PayPal), the output will break. The solution is to split each name/value pair on "=" before it is decoded (AKA unescaped), while making sure that each pair is split into exactly 2 parts. After that, all names and values can be decoded individually. The patch in the attachment does just that.
Subject: Business-PayPal-NVP.patch.txt
--- site/lib/Business/PayPal/NVP.pm Fri Sep 05 20:27:52 2008 +++ patchlib/Business/PayPal/NVP.pm Wed Dec 10 15:16:32 2008 @@ -85,8 +85,7 @@ return (); } - my @fields = map { URI::Escape::uri_unescape($_) } split('&', $res->content); - return map { split /=/ } @fields; + return map { URI::Escape::uri_unescape($_) } map { split /=/, $_, 2 } split /&/, $res->content; } sub _build_content {
Sorry for not closing this—this was fixed in 1.04 on 17 July 2009.