From: Sarah Hoffmann Date: Wed, 15 Oct 2014 22:37:42 +0000 (+0200) Subject: fix warning about missing HTTP_USER_AGENT X-Git-Tag: deploy~507 X-Git-Url: https://git.openstreetmap.org./nominatim.git/commitdiff_plain/9b86ac939cab0d54f82d2560f222da5390dccc18 fix warning about missing HTTP_USER_AGENT --- 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]).')';