Skip to content

Trying to access array offset on value of type null #15452

@Findus23

Description

@Findus23

Reported in https://forum.matomo.org/t/new-core-tracker-settings-php-notice-in-apache-error-logs-on-matomo-3-13-1-and-php-7-4/35786

PHP Notice: Trying to access array offset on value of type null in /core/Tracker/Settings.php on line 44

Line 44 is a device/browser type check

if ($aBrowserInfo[‘type’] != ‘browser’) {

I wrapped it in an if(!empty($aBrowserInfo[‘type’])) statement (as opposed to just suppressing the notices) to see if that would make the notices go away.

$aBrowserInfo = $deviceDetector->getClient();
if ($aBrowserInfo['type'] != 'browser') {
// for now only track browsers
unset($aBrowserInfo);
}

Metadata

Metadata

Assignees

Labels

BugFor errors / faults / flaws / inconsistencies etc.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions