Undefined array key “HTTP_ACCEPT_LANGUAGE”
-
We’re receiving this warning on PHP 8.2:
PHP Warning:? Undefined array key "HTTP_ACCEPT_LANGUAGE" in /wp-content/plugins/countdown-builder/classes/countdown/CircleCountdown.php on line 182
I copied the change you made in SimpleCountdown.php to fix the same error, changing line 182 of CircleCountdown.php from this:
$lang = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2);
to this:
$serverLang = ''; if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $serverLang = $_SERVER['HTTP_ACCEPT_LANGUAGE']; } $lang = substr($serverLang, 0, 2);
and that fixed it, but obviously we’d prefer a permanent fix in the plugin ?? Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Undefined array key “HTTP_ACCEPT_LANGUAGE”’ is closed to new replies.