country searches not filtered by countrycodes param, fixes #3756

This commit is contained in:
Brian Quinion 2011-05-11 10:30:58 +00:00
parent 6f946360c4
commit 6ff987322b

View File

@ -664,7 +664,9 @@
{
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);
}
}