Skip to content

Commit

Permalink
geonames.org now requires a "username" parameter.
Browse files Browse the repository at this point in the history
...though currently, it seems to accept any value.
  • Loading branch information
mrubinsk committed Mar 18, 2019
1 parent 22a14c4 commit 1a7bf42
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Horde/Core/Ajax/Imple/Geocoder/Geonames.php
Expand Up @@ -50,6 +50,14 @@ protected function _handle(Horde_Variables $vars)
throw new Horde_Exception('Incorrect parameters');
}

if (empty($vars->key)) {
throw new Horde_Exception('Missing required key parameter');
}

$url->add(array(
'username' => $vars->key
));

$response = $GLOBALS['injector']->getInstance('Horde_Core_Factory_HttpClient')->create()->get($url);

return new Horde_Core_Ajax_Response_Prototypejs(array(
Expand Down

0 comments on commit 1a7bf42

Please sign in to comment.