Skip to content

Commit

Permalink
Merge pull request #92 from ozh/curlopt
Browse files Browse the repository at this point in the history
Restrict CURLOPT_PROTOCOLS on `defined()` instead of `version_compare()`
  • Loading branch information
rmccue committed Dec 31, 2013
2 parents 14b5f32 + 6856025 commit 541e6d0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion library/Requests/Transport/cURL.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

/**
Expand Down

0 comments on commit 541e6d0

Please sign in to comment.