Skip to content
Permalink
Browse files

v0.2.2

fix parse data
  • Loading branch information...
Anisan committed Apr 12, 2019
1 parent 992c751 commit d45c5ab57466ef1627377eb5dfa1c1171a0bd185
Showing with 8 additions and 4 deletions.
  1. +8 −4 modules/google_location/google_location.class.php
@@ -289,15 +289,19 @@ public function getLocationData() {
throw new Exception('Not valid json result : ' . $result);
}
$result = json_decode($result, true);
if (!isset($result[0])) {
if (!isset($result[9])) {
throw new Exception('Error json data : ' . json_encode($result));
}
return $result;
}
function is_json($string) {
json_decode($string);
return (json_last_error() == JSON_ERROR_NONE);
private function is_json($string) {
json_decode($string, true);
if (json_last_error() != JSON_ERROR_NONE) {
$error = json_last_error_msg();
throw new \LogicException(sprintf("Failed to parse json string '%s', error: '%s'", $string, $error));
}
return true;
}
public function get_headers_from_curl_response($response) {

0 comments on commit d45c5ab

Please sign in to comment.
You can’t perform that action at this time.