Avoid error on PHP 5.6

This commit is contained in:
Laurent Destailleur 2021-04-19 20:49:31 +02:00
parent 511b138413
commit 3df79dd3c8

View File

@ -217,9 +217,11 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation =
break; break;
} }
// Set CURLOPT_CONNECT_TO so curl will not try another resolution that may give a different result // Set CURLOPT_CONNECT_TO so curl will not try another resolution that may give a different result. Possible only on PHP v7+
if (defined('CURLOPT_CONNECT_TO')) {
curl_setopt($ch, CURLOPT_CONNECT_TO, $iptocheck); curl_setopt($ch, CURLOPT_CONNECT_TO, $iptocheck);
} }
}
// Getting response from server // Getting response from server
$response = curl_exec($ch); $response = curl_exec($ch);