From 685602588233049402a50dde8bb07fc66178cf0d Mon Sep 17 00:00:00 2001 From: ozh Date: Mon, 30 Dec 2013 21:26:43 +0100 Subject: [PATCH] Restrict CURLOPT_PROTOCOLS --- library/Requests/Transport/cURL.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/Requests/Transport/cURL.php b/library/Requests/Transport/cURL.php index ad71fbf86..6a1e69b8e 100755 --- a/library/Requests/Transport/cURL.php +++ b/library/Requests/Transport/cURL.php @@ -68,9 +68,12 @@ public function __construct() { if (version_compare($this->version, '7.10.5', '>=')) { curl_setopt($this->fp, CURLOPT_ENCODING, ''); } - if (version_compare($this->version, '7.19.4', '>=')) { + if (defined('CURLOPT_PROTOCOLS')) { curl_setopt($this->fp, CURLOPT_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); } + if (defined('CURLOPT_REDIR_PROTOCOLS')) { + curl_setopt($this->fp, CURLOPT_REDIR_PROTOCOLS, CURLPROTO_HTTP | CURLPROTO_HTTPS); + } } /**