mirror of
https://github.com/osm-search/Nominatim.git
synced 2026-03-12 05:44:06 +00:00
correctly handle comma-only exclude_place_ids
This commit is contained in:
@@ -222,9 +222,12 @@
|
|||||||
foreach(explode(',',$aParams['exclude_place_ids']) as $iExcludedPlaceID)
|
foreach(explode(',',$aParams['exclude_place_ids']) as $iExcludedPlaceID)
|
||||||
{
|
{
|
||||||
$iExcludedPlaceID = (int)$iExcludedPlaceID;
|
$iExcludedPlaceID = (int)$iExcludedPlaceID;
|
||||||
if ($iExcludedPlaceID) $aExcludePlaceIDs[$iExcludedPlaceID] = $iExcludedPlaceID;
|
if ($iExcludedPlaceID)
|
||||||
|
$aExcludePlaceIDs[$iExcludedPlaceID] = $iExcludedPlaceID;
|
||||||
}
|
}
|
||||||
$this->aExcludePlaceIDs = $aExcludePlaceIDs;
|
|
||||||
|
if (isset($aExcludePlaceIDs))
|
||||||
|
$this->aExcludePlaceIDs = $aExcludePlaceIDs;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only certain ranks of feature
|
// Only certain ranks of feature
|
||||||
|
|||||||
@@ -166,6 +166,13 @@ Feature: Simple Tests
|
|||||||
| attr | value
|
| attr | value
|
||||||
| exclude_place_ids | 123,76,342565
|
| exclude_place_ids | 123,76,342565
|
||||||
|
|
||||||
|
Scenario: Empty XML search with bad exluded place ids
|
||||||
|
Given the request parameters
|
||||||
|
| exclude_place_ids
|
||||||
|
| ,
|
||||||
|
When sending xml search query "jghrleoxsbwjer"
|
||||||
|
Then result header has no attribute exclude_place_ids
|
||||||
|
|
||||||
Scenario Outline: Wrapping of legal jsonp search requests
|
Scenario Outline: Wrapping of legal jsonp search requests
|
||||||
Given the request parameters
|
Given the request parameters
|
||||||
| json_callback
|
| json_callback
|
||||||
|
|||||||
@@ -143,6 +143,11 @@ def api_result_header_contains(step):
|
|||||||
assert_in(line['attr'], world.result_header)
|
assert_in(line['attr'], world.result_header)
|
||||||
m = re.match("%s$" % (line['value'],), world.result_header[line['attr']])
|
m = re.match("%s$" % (line['value'],), world.result_header[line['attr']])
|
||||||
|
|
||||||
|
@step(u'result header has no attribute (.*)')
|
||||||
|
def api_result_header_contains_not(step, attr):
|
||||||
|
step.given('the result is valid')
|
||||||
|
assert_not_in(attr, world.result_header)
|
||||||
|
|
||||||
@step(u'results contain$')
|
@step(u'results contain$')
|
||||||
def api_result_contains(step):
|
def api_result_contains(step):
|
||||||
step.given('at least 1 result is returned')
|
step.given('at least 1 result is returned')
|
||||||
|
|||||||
Reference in New Issue
Block a user