Error messages: Undefined array key "HTTP_ACCEPT_LANGUAGE"

I’ve recently started getting these error messages in the error log repeatedly:

/manager/controllers/default/security/login.class.php : 191) PHP warning: Undefined array key "HTTP_ACCEPT_LANGUAGE"

The line of code in question is:

                $accept_languages = strtolower($_SERVER['HTTP_ACCEPT_LANGUAGE']);

Any idea what’s causing them? Thanks.

It’s only a warning. The code should still run correctly.

It probably means that the request to the manager has no Accept-Language request header. The code tries to read the value from the $_SERVER array, but this key isn’t available.

PHP 8 generates a warning in such a case. PHP 7.4 just ignored it.