From 8626c762f6faab25e0d75f14e34284d255657853 Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Mon, 15 Nov 2021 11:34:28 +0100 Subject: [PATCH] Another PHP 8.1 fix Fixes this deprecation warning: ``` PHP Deprecated: strtoupper(): Passing null to parameter #1 ($string) of type string is deprecated in /srv/matomo/vendor/matomo/matomo-php-tracker/MatomoTracker.php on line 1623 ``` --- MatomoTracker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MatomoTracker.php b/MatomoTracker.php index e3efc8f..fe3a0b0 100644 --- a/MatomoTracker.php +++ b/MatomoTracker.php @@ -1620,7 +1620,7 @@ protected function sendRequest($url, $method = 'GET', $data = null, $force = fal $forcePostUrlEncoded = false; if (!$this->doBulkRequests) { - if (strtoupper($this->requestMethod) === 'POST') { + if (!empty($this->requestMethod) && strtoupper($this->requestMethod) === 'POST') { // POST ALL parameters and have no GET parameters $urlParts = explode('?', $url);