From b7a9c85118be91c3dd1d0aa65c22b77de1fc5ef5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20S=CC=8Ckoda?= Date: Sat, 8 Dec 2012 11:58:05 +0100 Subject: [PATCH] MDL-35456 use HTTP 1.1 for PayPal IPN --- enrol/paypal/ipn.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/enrol/paypal/ipn.php b/enrol/paypal/ipn.php index 67fb06fa997..0d72b2c8de4 100644 --- a/enrol/paypal/ipn.php +++ b/enrol/paypal/ipn.php @@ -90,13 +90,14 @@ if (! $plugin_instance = $DB->get_record("enrol", array("id"=>$data->instanceid, $plugin = enrol_get_plugin('paypal'); /// Open a connection back to PayPal to validate the data +$paypaladdr = empty($CFG->usepaypalsandbox) ? 'www.paypal.com' : 'www.sandbox.paypal.com'; $c = new curl(); $options = array( 'returntransfer' => true, - 'httpheader' => array('application/x-www-form-urlencoded'), + 'httpheader' => array('application/x-www-form-urlencoded', "Host: $paypaladdr"), 'timeout' => 30, + 'CURLOPT_HTTP_VERSION' => CURL_HTTP_VERSION_1_1, ); -$paypaladdr = empty($CFG->usepaypalsandbox) ? 'www.paypal.com' : 'www.sandbox.paypal.com'; $location = "https://$paypaladdr/cgi-bin/webscr"; $result = $c->post($location, $req, $options);