diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2021-03-13 08:58:31 +0000 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2021-03-13 09:18:42 +0000 |
| commit | 08b5db2af7b56fafdef6563369bf89966bc0e451 (patch) | |
| tree | c9537f80ce434e989e461d3563cae336696e7116 /app/Http/RequestHandlers/AutoCompletePlace.php | |
| parent | 90288370403060744b506537895bce97ce70617c (diff) | |
| download | webtrees-08b5db2af7b56fafdef6563369bf89966bc0e451.tar.gz webtrees-08b5db2af7b56fafdef6563369bf89966bc0e451.tar.bz2 webtrees-08b5db2af7b56fafdef6563369bf89966bc0e451.zip | |
CodeStyle
Diffstat (limited to 'app/Http/RequestHandlers/AutoCompletePlace.php')
| -rw-r--r-- | app/Http/RequestHandlers/AutoCompletePlace.php | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/Http/RequestHandlers/AutoCompletePlace.php b/app/Http/RequestHandlers/AutoCompletePlace.php index 9e3f297bb6..e15d6ca38b 100644 --- a/app/Http/RequestHandlers/AutoCompletePlace.php +++ b/app/Http/RequestHandlers/AutoCompletePlace.php @@ -33,6 +33,8 @@ use function is_array; use function json_decode; use function rawurlencode; +use const JSON_THROW_ON_ERROR; + /** * Autocomplete handler for places */ @@ -74,7 +76,7 @@ class AutoCompletePlace extends AbstractAutocompleteHandler $client = new Client(); try { $json = $client->get($url, self::GUZZLE_OPTIONS)->getBody()->__toString(); - $places = json_decode($json, true); + $places = json_decode($json, true, 512, JSON_THROW_ON_ERROR); if (isset($places['geonames']) && is_array($places['geonames'])) { foreach ($places['geonames'] as $k => $place) { $data->add($place['name'] . ', ' . $place['adminName2'] . ', ' . $place['adminName1'] . ', ' . $place['countryName']); |
