]> git.openstreetmap.org Git - nominatim.git/commitdiff
Merge branch 'master' of github.com:twain47/Nominatim
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Fri, 14 Dec 2012 20:48:33 +0000 (20:48 +0000)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Fri, 14 Dec 2012 20:48:33 +0000 (20:48 +0000)
lib/lib.php
lib/template/address-json.php
lib/template/address-jsonv2.php
lib/template/address-xml.php
lib/template/search-jsonv2.php
sql/functions.sql
website/search.php

index 07ef2f95456fae2d9f8960b3e9262db5ec80d900..2c335c49eaf6a83fdb3feea45d6775d2e67e6d0e 100644 (file)
                }
 
                $aLanguages = array();
-               if (preg_match_all('/(([a-z]{1,8})(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $aLanguagesParse, PREG_SET_ORDER))
-               {
-                       foreach($aLanguagesParse as $iLang => $aLanguage)
+               if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) {
+                       if (preg_match_all('/(([a-z]{1,8})(-[a-z]{1,8})?)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $aLanguagesParse, PREG_SET_ORDER))
                        {
-                               $aLanguages[$aLanguage[1]] = isset($aLanguage[5])?(float)$aLanguage[5]:1 - ($iLang/100);
-                               if (!isset($aLanguages[$aLanguage[2]])) $aLanguages[$aLanguage[2]] = $aLanguages[$aLanguage[1]]/10;
+                               foreach($aLanguagesParse as $iLang => $aLanguage)
+                               {
+                                       $aLanguages[$aLanguage[1]] = isset($aLanguage[5])?(float)$aLanguage[5]:1 - ($iLang/100);
+                                       if (!isset($aLanguages[$aLanguage[2]])) $aLanguages[$aLanguage[2]] = $aLanguages[$aLanguage[1]]/10;
+                               }
+                               arsort($aLanguages);
                        }
-                       arsort($aLanguages);
-               }
+        }
                if (!sizeof($aLanguages)) $aLanguages = array(CONST_Default_Language=>1);
                foreach($aLanguages as $sLangauge => $fLangauagePref)
                {
index c05bce294e1837279815fd04ca69bf8c43787f30..0a1d074a3540e8f68aa0d323fbeff98307e1e0f0 100644 (file)
@@ -3,7 +3,7 @@
 
        if (!sizeof($aPlace))
        {
-               if ($sError)
+               if (isset($sError))
                        $aFilteredPlaces['error'] = $sError;
                else
                        $aFilteredPlaces['error'] = 'Unable to geocode';
index 4e751a0d4b458ba4f7cff9fbe7fe592863c92276..00f8750db3f97430f4975707a1ec6421762be796 100644 (file)
@@ -3,7 +3,7 @@
 
        if (!sizeof($aPlace))
        {
-               if ($sError)
+               if (isset($sError))
                        $aFilteredPlaces['error'] = $sError;
                else
                        $aFilteredPlaces['error'] = 'Unable to geocode';
index 75f69e1563c2a96cc8d27dddfb205a226680dcf8..fcd90b85e63cc6b9ea55c2accde01763244bebfa 100644 (file)
@@ -14,7 +14,7 @@
 
        if (!sizeof($aPlace))
        {
-               if ($sError)
+               if (isset($sError))
                        echo "<error>$sError</error>";
                else
                        echo "<error>Unable to geocode</error>";
index 671edde4b8fcaafcbf4e3f7bb53fa9fed32bb028..e1552a155ad53ec489791c78a9daa2927820be62 100644 (file)
@@ -40,7 +40,7 @@
 
                $aPlace['category'] = $aPointDetails['class'];
                $aPlace['type'] = $aPointDetails['type'];
-               if ($aPointDetails['icon'])
+               if (isset($aPointDetails['icon']))
                {
                        $aPlace['icon'] = $aPointDetails['icon'];
                }
index 4c679f3b7e4675f3a4ffe55ba73912da34a098ab..aa2a8908a1f24a664681524d8094b4c5d0a570a5 100644 (file)
@@ -1526,6 +1526,7 @@ BEGIN
 
         -- Merge address from parent
         nameaddress_vector := array_merge(nameaddress_vector, location.nameaddress_vector);
+        nameaddress_vector := array_merge(nameaddress_vector, location.name_vector);
 --return NEW;
         -- Performance, it would be more acurate to do all the rest of the import process but it takes too long
         -- Just be happy with inheriting from parent road only
index a619ed7805db9b3ffd0b8bbca2f224ecc8072c76..5ba2571bb5a221236db542b92312abd6e3d2951d 100755 (executable)
                logEnd($oDB, $hLog, sizeof($aToFilter));
        }
        $sMoreURL = CONST_Website_BaseURL.'search?format='.urlencode($sOutputFormat).'&exclude_place_ids='.join(',',$aExcludePlaceIDs);
-       $sMoreURL .= '&accept-language='.$_SERVER["HTTP_ACCEPT_LANGUAGE"];
+       if (isset($_SERVER["HTTP_ACCEPT_LANGUAGE"])) $sMoreURL .= '&accept-language='.$_SERVER["HTTP_ACCEPT_LANGUAGE"];
        if ($bShowPolygons) $sMoreURL .= '&polygon=1';
        if ($bShowAddressDetails) $sMoreURL .= '&addressdetails=1';
        if (isset($_GET['viewbox']) && $_GET['viewbox']) $sMoreURL .= '&viewbox='.urlencode($_GET['viewbox']);