Skip to content

@$_SERVER['HTTP_ACCEPT_LANGUAGE'] cause error in php >8 #20388

@hamburger123456

Description

@hamburger123456

in core/common.php the line: $browserLang = self::sanitizeInputValues(@$_SERVER['HTTP_ACCEPT_LANGUAGE']);
cause the error <<Undefined array key "HTTP_ACCEPT_LANGUAGE">> with some bots.
The @ (silent-mode) do not work longer as expected in php8.

use: if ( is_null($browserLang) && array_key_exists('HTTP_ACCEPT_LANGUAGE', $_SERVER) ) { ... insted

Metadata

Metadata

Assignees

Labels

BugFor errors / faults / flaws / inconsistencies etc.not-in-changelogFor issues or pull requests that should not be included in our release changelog on matomo.org.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions