]> git.openstreetmap.org Git - nominatim.git/commitdiff
tweak log output
authorSarah Hoffmann <lonvia@denofr.de>
Wed, 27 Mar 2013 21:22:57 +0000 (22:22 +0100)
committerSarah Hoffmann <lonvia@denofr.de>
Wed, 27 Mar 2013 21:22:57 +0000 (22:22 +0100)
lib/log.php

index d81ef46db55393f5d563ca5183b6575ea2f7e6f9..8022376d93a246272c27a69bb1c7caa54673214b 100644 (file)
 
                if (CONST_Log_DB)
                {
 
                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 = '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);
                }
 
                        $oDB->query($sSQL);
                }