-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39918 from nextcloud/backport/38665/stable25
[stable25] fix(weather_status): Pass address as param to OSM API
- Loading branch information
Showing
1 changed file
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
* @author Julien Veyssier <[email protected]> | ||
* @author Roeland Jago Douma <[email protected]> | ||
* | ||
* @license GNU AGPL version 3 or any later version | ||
* @license AGPL-3.0-or-later | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
|
@@ -310,13 +310,14 @@ public function setAddress(string $address): array { | |
*/ | ||
private function searchForAddress(string $address): array { | ||
$params = [ | ||
'q' => $address, | ||
'format' => 'json', | ||
'addressdetails' => '1', | ||
'extratags' => '1', | ||
'namedetails' => '1', | ||
'limit' => '1', | ||
]; | ||
$url = 'https://nominatim.openstreetmap.org/search/' . $address; | ||
$url = 'https://nominatim.openstreetmap.org/search'; | ||
$results = $this->requestJSON($url, $params); | ||
if (count($results) > 0) { | ||
return $results[0]; | ||
|