From: Marcel Werk Date: Wed, 15 Jul 2015 15:42:11 +0000 (+0200) Subject: Fixed encoding issue in paypal IPN callback X-Git-Tag: 2.1.6~9 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=99a9ef8a40ed65b49af2dc5e280895a04bde9c9d;p=GitHub%2FWoltLab%2FWCF.git Fixed encoding issue in paypal IPN callback --- 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');