Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihor-sviziev/f804e689acd83b8ab5f0 to your computer and use it in GitHub Desktop.
Save ihor-sviziev/f804e689acd83b8ab5f0 to your computer and use it in GitHub Desktop.
PayPal_Express_-_Fix_work_with_discount_v2.patch
Index: magento/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- magento/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php (revision de8690ea226be70199072586fead08fd204b3774)
+++ magento/app/code/core/Mage/PaypalUk/Model/Api/Nvp.php (revision )
@@ -519,9 +519,14 @@
protected function _buildQuery($request)
{
$result = '';
- foreach ($request as $k=>$v) {
+ foreach ($request as $k => $v) {
+ if (mb_stripos($v, '&') !== false || mb_stripos($v, '=') !== false) {
+ $k .= '[' . mb_strlen($v) . ']';
+ }
+
- $result .= '&'.$k.'='.$v;
+ $result .= '&' . $k . '=' . $v;
}
+
return trim($result, '&');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment