]> git.openstreetmap.org Git - nominatim.git/commitdiff
country searches not filtered by countrycodes param, fixes #3756
authorBrian Quinion <openstreetmap@brian.quinion.co.uk>
Wed, 11 May 2011 10:30:58 +0000 (10:30 +0000)
committerBrian Quinion <openstreetmap@brian.quinion.co.uk>
Wed, 11 May 2011 10:30:58 +0000 (10:30 +0000)
website/search.php

index 2ee07e3cd5d9538bcaf01f5ff8846a9db6f04751..1ef21e5c77ffa6fb8ccac0963e4247cb2df77e19 100755 (executable)
                                                        {
                                                                if (4 >= $iMinAddressRank && 4 <= $iMaxAddressRank)
                                                                {
-                                                                       $sSQL = "select place_id from placex where country_code='".$aSearch['sCountryCode']."' and rank_search = 4 order by st_area(geometry) desc limit 1";
+                                                                       $sSQL = "select place_id from placex where country_code='".$aSearch['sCountryCode']."' and rank_search = 4";
+                                                                       if ($sCountryCodesSQL) $sSQL .= " and country_code in ($sCountryCodesSQL)";                                                             
+                                                                       $sSQL .= " order by st_area(geometry) desc limit 1";
                                                                        $aPlaceIDs = $oDB->getCol($sSQL);
                                                                }
                                                        }