Skip to content

Commit 706aa83

Browse files
committed
use php.ini variables to configure curl #120
1 parent a7cf3d4 commit 706aa83

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/RequestResolvers/Curl.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ class Curl implements RequestResolverInterface
1818
CURLOPT_MAXREDIRS => 20,
1919
CURLOPT_CONNECTTIMEOUT => 10,
2020
CURLOPT_TIMEOUT => 10,
21-
CURLOPT_SSL_VERIFYHOST => false,
2221
CURLOPT_SSL_VERIFYPEER => false,
2322
CURLOPT_ENCODING => '',
2423
CURLOPT_AUTOREFERER => true,
@@ -38,6 +37,12 @@ class Curl implements RequestResolverInterface
3837
public function __construct($url, array $config)
3938
{
4039
$this->url = $url;
40+
41+
//http://stackoverflow.com/questions/14054652/getting-301-with-curl-despite-followlocation
42+
if (ini_get('open_basedir') !== '' && ini_get('safe_mode') === false) {
43+
$this->config[CURLOPT_SSL_VERIFYHOST] = false;
44+
}
45+
4146
$this->config = $config + $this->config;
4247
}
4348

0 commit comments

Comments
 (0)