From 8544b5ce822455a1e1a15bc4f588f0314b8a41f4 Mon Sep 17 00:00:00 2001 From: Jeremy Kersten Date: Thu, 20 Apr 2017 11:20:25 +0200 Subject: [PATCH] [FIX] payment_paypal: unquote the paypal response In some case (undefined), paypal return encoded params. https://cloud.githubusercontent.com/assets/7766939/24752163/43d31634-1aff-11e7-91ab-1c7a5a3b3ef0.png Since this fix don't break the case where there are no the +, if it could fix for others cases... This commit closes #14727, opw-727899 --- addons/payment_paypal/controllers/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/payment_paypal/controllers/main.py b/addons/payment_paypal/controllers/main.py index 2fefb1417ef..00359c4d038 100644 --- a/addons/payment_paypal/controllers/main.py +++ b/addons/payment_paypal/controllers/main.py @@ -23,7 +23,7 @@ class PaypalController(http.Controller): """ Extract the return URL from the data coming from paypal. """ return_url = post.pop('return_url', '') if not return_url: - custom = json.loads(post.pop('custom', False) or post.pop('cm', False) or '{}') + custom = json.loads(urllib.unquote_plus(post.pop('custom', False) or post.pop('cm', False) or '{}')) return_url = custom.get('return_url', '/') return return_url