X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FUtils%2FGeocode%2FGoogle.php;h=6ab1397fea8d8be13c67b0ca51c570f4dff30798;hb=5d73950a7163a46f1bce91dea0f79fad269f1cb2;hp=f8db5f4e6b0ecda9feb3fbe0ec515976fb872839;hpb=5e128ce5edbd7db72746812c0eb35c4d0fd6d938;p=civicrm-core.git diff --git a/CRM/Utils/Geocode/Google.php b/CRM/Utils/Geocode/Google.php index f8db5f4e6b..6ab1397fea 100644 --- a/CRM/Utils/Geocode/Google.php +++ b/CRM/Utils/Geocode/Google.php @@ -60,7 +60,7 @@ class CRM_Utils_Geocode_Google { $add .= ',+'; } - $city = CRM_Utils_Array::value('city', $values); + $city = $values['city'] ?? NULL; if ($city) { $add .= '+' . urlencode(str_replace('', '+', $city)); $add .= ',+'; @@ -105,10 +105,9 @@ class CRM_Utils_Geocode_Google { $query = 'https://' . self::$_server . self::$_uri . $add; - require_once 'HTTP/Request.php'; - $request = new HTTP_Request($query); - $request->sendRequest(); - $string = $request->getResponseBody(); + $client = new GuzzleHttp\Client(); + $request = $client->request('GET', $query); + $string = $request->getBody(); libxml_use_internal_errors(TRUE); $xml = @simplexml_load_string($string);