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 {