Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/UserCountry')
-rw-r--r--plugins/UserCountry/Archiver.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/plugins/UserCountry/Archiver.php b/plugins/UserCountry/Archiver.php
index 1fb9ad68b7..16eca3bd26 100644
--- a/plugins/UserCountry/Archiver.php
+++ b/plugins/UserCountry/Archiver.php
@@ -107,12 +107,13 @@ class Archiver extends \Piwik\Plugin\Archiver
$row[$column] = str_replace(self::LOCATION_SEPARATOR, '', $row[$column]);
}
- if (!empty($row[self::REGION_FIELD])) {
- $row[self::REGION_FIELD] = $row[self::REGION_FIELD] . self::LOCATION_SEPARATOR . $row[self::COUNTRY_FIELD];
+ // set city first, as containing region might be manipulated afterwards if not empty
+ if (!empty($row[self::CITY_FIELD])) {
+ $row[self::CITY_FIELD] = $row[self::CITY_FIELD] . self::LOCATION_SEPARATOR . $row[self::REGION_FIELD] . self::LOCATION_SEPARATOR . $row[self::COUNTRY_FIELD];
}
- if (!empty($row[self::CITY_FIELD])) {
- $row[self::CITY_FIELD] = $row[self::CITY_FIELD] . self::LOCATION_SEPARATOR . $row[self::REGION_FIELD];
+ if (!empty($row[self::REGION_FIELD])) {
+ $row[self::REGION_FIELD] = $row[self::REGION_FIELD] . self::LOCATION_SEPARATOR . $row[self::COUNTRY_FIELD];
}
}