From 3df79dd3c81f0067598f515aba89bd8ffb7247b1 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Mon, 19 Apr 2021 20:49:31 +0200 Subject: [PATCH] Avoid error on PHP 5.6 --- htdocs/core/lib/geturl.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/geturl.lib.php b/htdocs/core/lib/geturl.lib.php index 81ff51f00c7..0d729e6c762 100644 --- a/htdocs/core/lib/geturl.lib.php +++ b/htdocs/core/lib/geturl.lib.php @@ -217,8 +217,10 @@ function getURLContent($url, $postorget = 'GET', $param = '', $followlocation = break; } - // Set CURLOPT_CONNECT_TO so curl will not try another resolution that may give a different result - curl_setopt($ch, CURLOPT_CONNECT_TO, $iptocheck); + // 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); + } } // Getting response from server