From 6fe4bf16beae4d55bc95306803a97e998e7c13fe Mon Sep 17 00:00:00 2001 From: Nick Liu Date: Fri, 17 Jan 2020 15:46:15 +0100 Subject: [PATCH] Null coalescing for $_SERVER keys in online_class.php Resolves CLI-invoked E_NOTICE in: * e_online::goOnline() --- e107_handlers/online_class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e107_handlers/online_class.php b/e107_handlers/online_class.php index 07427299a..df823244c 100755 --- a/e107_handlers/online_class.php +++ b/e107_handlers/online_class.php @@ -118,7 +118,7 @@ class e_online $ip = e107::getIPHandler()->getIP(FALSE); $udata = ($user->isUser() && USER ? $user->getId().'.'.$user->getName() : '0'); // USER check required to make sure they logged in without an error. - $agent = $_SERVER['HTTP_USER_AGENT']; + $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : ''; // XXX - more exceptions, e.g. hide online location for admins/users (pref), e_jlsib.php, etc // XXX - more advanced flod timing when e_AJAX_REQUEST, e.g. $ban_access_ajax = 300