Trying to access array offset on value of type null · Issue #15452 · matomo-org/matomo · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Findus23 opened this issue Jan 24, 2020 · 0 comments
Closed

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

Findus23 opened this issue Jan 24, 2020 · 0 comments
Assignees
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@Findus23
Copy link
Member

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);
}

@Findus23 Findus23 added the Bug For errors / faults / flaws / inconsistencies etc. label Jan 24, 2020
@Findus23 Findus23 added this to the 3.13.2 milestone Jan 24, 2020
@sgiehl sgiehl self-assigned this Jan 24, 2020
@tsteur tsteur closed this as completed Jan 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

3 participants