Error: "Array offset on bool" in SecurityInfo. Matomo 4.1.0

Surfing in the settings, I came across the Security tab, sorted below the Diagnostics header. Once there, I was greeted by a reassuring message that something was amiss. It had a warm orangy-tinted background and carried just the right amount of urgency to do exactly as it said:

WARNING: PATH TO MATOMO/plugins/SecurityInfo/PhpSecInfo/Test/Application/php.php(39): Notice - Trying to access array offset on value of type bool - Matomo 4.1.0 - Please report this message in the Matomo forums: (please do a search first as it might have been reported already) (Module: SecurityInfo, Action: index, In CLI mode: false)

But maybe, I am just the conscientious kind of person.

Anyways. Thanks for the great product. If you need more info Iā€™m happy to help.

1 Like

+1 on everything said and mentioned in this message. :innocent:


Thanks for reporting.

Applying this change (so adding this one line) should fix it:

diff --git a/core/Http.php b/core/Http.php
index 4377ebac7ab..d2d688657ec 100644
--- a/core/Http.php
+++ b/core/Http.php
@@ -595,6 +595,7 @@ public static function sendHttpRequestBy(
                 // curl options (sorted oldest to newest)
                 CURLOPT_URL            => $aUrl,
                 CURLOPT_USERAGENT      => $userAgent,
+                CURLOPT_ENCODING       => "",
                 CURLOPT_HTTPHEADER     => array_merge(array(
1 Like