1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-01 20:30:39 +02:00

Null coalescing for $_SERVER keys in online_class.php

Resolves CLI-invoked E_NOTICE in:
* e_online::goOnline()
This commit is contained in:
Nick Liu
2020-01-17 15:46:15 +01:00
parent a49b532519
commit 6fe4bf16be

View File

@@ -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