]> git.openstreetmap.org Git - nominatim.git/blobdiff - website/search.php
country searches not filtered by countrycodes param, fixes #3756
[nominatim.git] / 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);
                                                                }
                                                        }