diff --git a/application/utils.inc.php b/application/utils.inc.php index 84ee1b28fd..bba4ff2439 100644 --- a/application/utils.inc.php +++ b/application/utils.inc.php @@ -1922,7 +1922,9 @@ SQL; $aResponseHeaders[$sName] = $sValue; } } - curl_close($ch); + if (PHP_VERSION_ID < 80000) { + curl_close($ch); + } return $response; } diff --git a/tests/php-unit-tests/src/BaseTestCase/ItopTestCase.php b/tests/php-unit-tests/src/BaseTestCase/ItopTestCase.php index 65c1d6edaf..9fd0c8fe9c 100644 --- a/tests/php-unit-tests/src/BaseTestCase/ItopTestCase.php +++ b/tests/php-unit-tests/src/BaseTestCase/ItopTestCase.php @@ -686,7 +686,9 @@ abstract class ItopTestCase extends KernelTestCase $this->aLastCurlGetInfo = $info; $sErrorMsg = curl_error($ch); $iErrorCode = curl_errno($ch); - curl_close($ch); + if (PHP_VERSION_ID < 80000) { + curl_close($ch); + } \IssueLog::Info(__METHOD__, null, ['url' => $sUrl, 'error' => $sErrorMsg, 'error_code' => $iErrorCode, 'post_fields' => $aPostFields, 'info' => $info]); diff --git a/tests/php-unit-tests/unitary-tests/setup/unattended-install/UnattendedInstallTest.php b/tests/php-unit-tests/unitary-tests/setup/unattended-install/UnattendedInstallTest.php index ed6ed2e504..811be8b86a 100644 --- a/tests/php-unit-tests/unitary-tests/setup/unattended-install/UnattendedInstallTest.php +++ b/tests/php-unit-tests/unitary-tests/setup/unattended-install/UnattendedInstallTest.php @@ -39,7 +39,9 @@ class UnattendedInstallTest extends ItopDataTestCase curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); $sJson = curl_exec($ch); - curl_close($ch); + if (PHP_VERSION_ID < 80000) { + curl_close($ch); + } return $sJson; } public function testCallUnattendedInstallFromHttp()