Is it possible to have the code that fixes posted?
All of the changes are in the paypal standard gateway. I’d recommend using a “diff” program to compare the files (like Kaleidoscope or Changes on the Mac http://www.kaleidoscopeapp.com/). The primary change was:
THIS:
// Fix for multi-line data
foreach ($post as $key => $value)
{
// Thanks to Dom.S for finding a cure for this multi-line issue.
$cleaned = preg_replace('/(.*[^%^0^D])(
)(.*)/i','${1}
${3}', urldecode($value));
$post[$key] = $cleaned;
}
$data = $this->data_array_to_string($post);
CHANGED TO:
$data = $this->data_array_to_string($post);
// Fix for multi-line data
// Thanks to Dom.S for finding a cure for this multi-line issue.
// and to me for finally figuring out I needed to move this AFTER I urlencoded the data
// ***** facepalm ******
$data = preg_replace('/(.*[^%^0^D])(
)(.*)/i','${1}
${3}', $data);
Rather than changing CartThrob in the future, I’d recommend using the built in Extension hooks to extend and override it. That’s what they’re there for. And if there’s behavior you can’t override, let us know, and we might add a new hook to control it. At the present, I’d strongly recommend undoing any existing hacks and move them out into extensions. Writing an extension is, for the most part pretty easy once you’ve seen it done once…. especially if you’ve already got the code doing what you want.