From c28eb2d32b9d63bb4f9ffc325140d524540a4de8 Mon Sep 17 00:00:00 2001 From: Karin Gerritsen Date: Wed, 5 Oct 2016 06:42:00 -0600 Subject: [PATCH] Porting back fuzionnz/CRM-18830 --- CRM/Utils/Geocode/Google.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Utils/Geocode/Google.php b/CRM/Utils/Geocode/Google.php index 80d35116b6..87c3296f6b 100644 --- a/CRM/Utils/Geocode/Google.php +++ b/CRM/Utils/Geocode/Google.php @@ -117,7 +117,11 @@ class CRM_Utils_Geocode_Google { $add .= '+' . urlencode(str_replace('', '+', $values['country'])); } - $query = 'http://' . self::$_server . self::$_uri . $add; + if (!empty($config->geoAPIKey)) { + $add .= '&key=' . urlencode($config->geoAPIKey); + } + + $query = 'https://' . self::$_server . self::$_uri . $add; require_once 'HTTP/Request.php'; $request = new HTTP_Request($query); -- 2.25.1