Repository navigation
fix php 8.5 deprecations - #183
Conversation
textagroup
left a comment
There was a problem hiding this comment.
All seems to work OK.
Ran an AI review which brought up the one minor issue
• Found one issue:
-
P2 – stale headers can be reused after a failed request.
In classes/WP_Piwik/Request/Rest.php:153, libs/matomo-php-tracker/MatomoTracker.php:2217, and proxy/proxy.php:426, PHP 8.4+ reads http_get_last_response_headers() without first clearing the
previously stored response. If multiple stream requests occur in one PHP request and a later request fails before receiving headers, the previous response’s status/cookies may be treated as belonging
to the failed request. PHP provides http_clear_last_response_headers() specifically for clearing this state. PHP documentationAdd a clear immediately before each file_get_contents() call, and add a regression test covering successful request followed by transport failure.
Description
As title. Also introduces a matrix for the phpunit github actions workflow (testing against php 7.4 and 8.5).
Checklist
Review