From 99a9ef8a40ed65b49af2dc5e280895a04bde9c9d Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Wed, 15 Jul 2015 17:42:11 +0200 Subject: [PATCH] Fixed encoding issue in paypal IPN callback --- .../files/lib/action/PaypalCallbackAction.class.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wcfsetup/install/files/lib/action/PaypalCallbackAction.class.php b/wcfsetup/install/files/lib/action/PaypalCallbackAction.class.php index b766a9c912..f570a71ba8 100644 --- a/wcfsetup/install/files/lib/action/PaypalCallbackAction.class.php +++ b/wcfsetup/install/files/lib/action/PaypalCallbackAction.class.php @@ -5,6 +5,7 @@ use wcf\data\object\type\ObjectTypeCache; use wcf\system\exception\SystemException; use wcf\system\payment\type\IPaymentType; use wcf\util\HTTPRequest; +use wcf\util\StringUtil; /** * Handles Paypal callbacks. @@ -48,6 +49,13 @@ class PaypalCallbackAction extends AbstractAction { throw new SystemException('request not validated'); } + // fix encoding + if (!empty($_POST['charset']) && strtoupper($_POST['charset']) != 'UTF-8') { + foreach ($_POST as &$value) { + $value = StringUtil::convertEncoding(strtoupper($_POST['charset']), 'UTF-8', $value); + } + } + // Check that receiver_email is your Primary PayPal email if (strtolower($_POST['business']) != strtolower(PAYPAL_EMAIL_ADDRESS) && (strtolower($_POST['receiver_email']) != strtolower(PAYPAL_EMAIL_ADDRESS))) { throw new SystemException('invalid business or receiver_email'); -- 2.20.1