1
0
mirror of https://github.com/Mibew/mibew.git synced 2025-04-12 02:30:10 +03:00

Check if HTTP_USER_AGENT is set, use empty string otherwise

This commit is contained in:
jmechnich 2021-12-01 20:38:33 +01:00
parent 637758c13e
commit e676ca47dc
3 changed files with 9 additions and 3 deletions
src/mibew/libs
chat.php
classes/Mibew/RequestProcessor
track.php

View File

@ -644,7 +644,9 @@ function chat_start_for_user(
) { ) {
// Get user info // Get user info
$remote_host = get_remote_host(); $remote_host = get_remote_host();
$user_browser = $_SERVER['HTTP_USER_AGENT']; $user_browser = isset($_SERVER['HTTP_USER_AGENT'])
? $_SERVER['HTTP_USER_AGENT']
: '';
// Check connection limit // Check connection limit
if (Thread::connectionLimitReached($remote_host)) { if (Thread::connectionLimitReached($remote_host)) {

View File

@ -774,7 +774,9 @@ class ThreadProcessor extends ClientSideProcessor implements
// Create thread for left message // Create thread for left message
$remote_host = get_remote_host(); $remote_host = get_remote_host();
$user_browser = $_SERVER['HTTP_USER_AGENT']; $user_browser = isset($_SERVER['HTTP_USER_AGENT'])
? $_SERVER['HTTP_USER_AGENT']
: '';
$visitor = visitor_from_request(); $visitor = visitor_from_request();
// Get message locale // Get message locale

View File

@ -187,7 +187,9 @@ function track_get_path($visitor)
function track_build_details() function track_build_details()
{ {
$result = array( $result = array(
'user_agent' => $_SERVER['HTTP_USER_AGENT'], 'user_agent' => (isset($_SERVER['HTTP_USER_AGENT'])
? $_SERVER['HTTP_USER_AGENT']
: ''),
'remote_host' => get_remote_host(), 'remote_host' => get_remote_host(),
); );