]> git.openstreetmap.org Git - nominatim.git/blobdiff - lib/log.php
Merge remote-tracking branch 'upstream/master'
[nominatim.git] / lib / log.php
index 361c0fb10cdd15ab1a3009fe3455ce038f546418..59e04d1745baf59f5e96232b59984187188f69df 100644 (file)
@@ -3,7 +3,7 @@
        function logStart(&$oDB, $sType = '', $sQuery = '', $aLanguageList = array())
        {
                $aStartTime = explode('.',microtime(true));
        function logStart(&$oDB, $sType = '', $sQuery = '', $aLanguageList = array())
        {
                $aStartTime = explode('.',microtime(true));
-               if (!$aStartTime[1]) $aStartTime[1] = '0';
+               if (!isset($aStartTime[1])) $aStartTime[1] = '0';
 
                $sOutputFormat = '';
                if (isset($_GET['format'])) $sOutputFormat = $_GET['format'];
 
                $sOutputFormat = '';
                if (isset($_GET['format'])) $sOutputFormat = $_GET['format'];
@@ -19,6 +19,8 @@
                {
                        if (isset($_GET['email']))
                                $sUserAgent = $_GET['email'];
                {
                        if (isset($_GET['email']))
                                $sUserAgent = $_GET['email'];
+                       elseif (isset($_SERVER['HTTP_REFERER']))
+                               $sUserAgent = $_SERVER['HTTP_REFERER'];
                        else
                                $sUserAgent = $_SERVER['HTTP_USER_AGENT'];
                        $sSQL = 'insert into new_query_log (type,starttime,query,ipaddress,useragent,language,format,searchterm)';
                        else
                                $sUserAgent = $_SERVER['HTTP_USER_AGENT'];
                        $sSQL = 'insert into new_query_log (type,starttime,query,ipaddress,useragent,language,format,searchterm)';