From: Christian Wach Date: Mon, 16 Nov 2020 19:20:49 +0000 (+0000) Subject: Prevent PayPal from double-encoding the IPN Notify URL X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=9b2d484fddf3e2227f66b8b3ce77edb8e41725c4;p=civicrm-core.git Prevent PayPal from double-encoding the IPN Notify URL --- diff --git a/CRM/Core/Payment/PayPalImpl.php b/CRM/Core/Payment/PayPalImpl.php index e2f8cb7596..57dd8cc633 100644 --- a/CRM/Core/Payment/PayPalImpl.php +++ b/CRM/Core/Payment/PayPalImpl.php @@ -976,6 +976,14 @@ class CRM_Core_Payment_PayPalImpl extends CRM_Core_Payment { // Allow further manipulation of the arguments via custom hooks .. CRM_Utils_Hook::alterPaymentProcessorParams($this, $params, $paypalParams); + /* + * PayPal urlencodes the IPN Notify URL. For sites not using Clean URLs (or + * using Shortcodes in WordPress) this results in "%2F" becoming "%252F" and + * therefore incomplete transactions. We need to prevent that. + * @see https://lab.civicrm.org/dev/core/-/issues/1931 + */ + $paypalParams['notify_url'] = rawurldecode($paypalParams['notify_url']); + $uri = ''; foreach ($paypalParams as $key => $value) { if ($value === NULL) {