Skip to content

Commit 4ca754e

Browse files
committed
Conditionally close the curl handle
`curl_close` has no effect since PHP 8.0 and is deprecated since 8.5 https://www.php.net/curl_close
1 parent 9462dc6 commit 4ca754e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

MatomoTracker.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2141,7 +2141,11 @@ protected function sendRequest(string $url, string $method = 'GET', $data = null
21412141

21422142
$this->parseIncomingCookies(explode("\r\n", $header));
21432143
} finally {
2144-
curl_close($ch);
2144+
// curl_close has no effect since PHP 8.0
2145+
if (PHP_VERSION_ID < 80000) {
2146+
curl_close($ch);
2147+
}
2148+
21452149
ob_end_clean();
21462150
}
21472151
} elseif (function_exists('stream_context_create')) {

0 commit comments

Comments
 (0)