]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/log.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / lib / log.php
index d81ef46db55393f5d563ca5183b6575ea2f7e6f9..8022376d93a246272c27a69bb1c7caa54673214b 100644 (file)
 
                if (CONST_Log_DB)
                {
+                       if (isset($_GET['email']))
+                               $sUserAgent = $_GET['email'];
+                       else
+                               $sUserAgent = $_SERVER['HTTP_USER_AGENT'];
                        $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($_SERVER['HTTP_USER_AGENT']).','.getDBQuoted(join(',',$aLanguageList)).','.getDBQuoted($_GET['format']).','.getDBQuoted($hLog[3]).')';
+                       $sSQL .= ','.getDBQuoted($hLog[1]).','.getDBQuoted($sUserAgent).','.getDBQuoted(join(',',$aLanguageList)).','.getDBQuoted($sOutputFormat).','.getDBQuoted($hLog[3]).')';
                        $oDB->query($sSQL);
                }