From 9b86ac939cab0d54f82d2560f222da5390dccc18 Mon Sep 17 00:00:00 2001 From: Sarah Hoffmann Date: Thu, 16 Oct 2014 00:37:42 +0200 Subject: [PATCH] fix warning about missing HTTP_USER_AGENT --- lib/log.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/log.php b/lib/log.php index 59e04d17..c2103716 100644 --- a/lib/log.php +++ b/lib/log.php @@ -21,8 +21,10 @@ $sUserAgent = $_GET['email']; elseif (isset($_SERVER['HTTP_REFERER'])) $sUserAgent = $_SERVER['HTTP_REFERER']; - else + elseif (isset($_SERVER['HTTP_USER_AGENT'])) $sUserAgent = $_SERVER['HTTP_USER_AGENT']; + else + $sUserAgent = ''; $sSQL = 'insert into new_query_log (type,starttime,query,ipaddress,useragent,language,format,searchterm)'; $sSQL .= ' values ('.getDBQuoted($sType).','.getDBQuoted($hLog[0]).','.getDBQuoted($hLog[2]); $sSQL .= ','.getDBQuoted($hLog[1]).','.getDBQuoted($sUserAgent).','.getDBQuoted(join(',',$aLanguageList)).','.getDBQuoted($sOutputFormat).','.getDBQuoted($hLog[3]).')'; -- 2.39.5