Skip to content

Commit 2cf6f25

Browse files
committed
Merge pull request paquettg#13 from Bizarrus/patch-1
Check if open_basedir is enabled: Dont use CURLOPT_FOLLOWLOCATION
2 parents 583d83b + 29bb39d commit 2cf6f25

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/PHPHtmlParser/Curl.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@ class Curl implements CurlInterface {
1515
public function get($url)
1616
{
1717
$ch = curl_init($url);
18-
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
18+
19+
if(!ini_get('open_basedir')) {
20+
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
21+
}
22+
1923
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
2024
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
2125

0 commit comments

Comments
 (0)