mirror of
https://github.com/osm-search/Nominatim.git
synced 2024-09-19 15:08:31 +03:00
always use object type for details keywords
When name and address is empty, the keywords field in the response of the details API would be an array because that is what PHP's json_encode defaults to with empty array(). This default can only be changed globally per json_encode call and that might cause unintended colleteral damage. Work around the issue by making name and address an empty array instead of keywords. Fixes #2329.
This commit is contained in:
parent
925726222f
commit
fef1bbb1a7
@ -81,10 +81,14 @@ if ($bIncludeKeywords) {
|
||||
|
||||
if ($aPlaceSearchNameKeywords) {
|
||||
$aPlaceDetails['keywords']['name'] = array_map($funcMapKeyword, $aPlaceSearchNameKeywords);
|
||||
} else {
|
||||
$aPlaceDetails['keywords']['name'] = array();
|
||||
}
|
||||
|
||||
if ($aPlaceSearchAddressKeywords) {
|
||||
$aPlaceDetails['keywords']['address'] = array_map($funcMapKeyword, $aPlaceSearchAddressKeywords);
|
||||
} else {
|
||||
$aPlaceDetails['keywords']['address'] = array();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user