--- google.inc
+++ google.inc.PATCHED
@@ -93,6 +93,7 @@
  *   an associative array with keys 'lat' and 'lon' containing the coordinates.
  */
 function google_geocode_location($location = array()) {
+  $country_code = $location['country']; // preserve country code for later result comparison
   switch ($location['country']) {
     case 'li':
       $location['country'] = 'Liechtenstein';
@@ -141,6 +142,12 @@
     return NULL;
   }
 
+  preg_match('/<CountryNameCode>(.*)<\/CountryNameCode>/', $http_reply->data, $status_code_match);
+  $country_code_result = $status_code_match[1];
+  if (strtolower($country_code_result) != strtolower($country_code)) {
+    return NULL;
+  }
+
   $accuracy_code_match = array();
   preg_match('/Accuracy="([0-9])"/', $http_reply->data, $accuracy_code_match);
   $accuracy_code = $accuracy_code_match[1];
