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:
authormattab <matthieu.aubry@gmail.com>2014-05-09 04:38:24 +0400
committermattab <matthieu.aubry@gmail.com>2014-05-09 04:38:24 +0400
commitf27c691bfd692e88a7e02d3170c58c6b7f01ea24 (patch)
tree2d4abe3e9d7bbb01a3446fcd6210e5b7e84f05e5 /core/Updater.php
parentaa810b6e84d6b48a336e2e4dc6e16b97b66e9fd0 (diff)
Fixes #5115 Fixes couple issues in the logic which should finally solve reported issues.
Diffstat (limited to 'core/Updater.php')
-rw-r--r--core/Updater.php21
1 files changed, 8 insertions, 13 deletions
diff --git a/core/Updater.php b/core/Updater.php
index a1f39fb71b..d579fd28f1 100644
--- a/core/Updater.php
+++ b/core/Updater.php
@@ -252,26 +252,21 @@ class Updater
throw $e;
}
}
- if ($currentVersion === false) {
- if ($name === 'core') {
- // This should not happen
- $currentVersion = Version::VERSION;
- } else {
- // When plugins have been installed since Piwik 2.0 this should not happen
- // We "fix" the data for any plugin that may have been ported from Piwik 1.x
- $currentVersion = $version;
- }
+
+ if ($name === 'core' && $currentVersion === false) {
+ // This should not happen
+ $currentVersion = Version::VERSION;
self::recordComponentSuccessfullyUpdated($name, $currentVersion);
}
- $versionCompare = version_compare($currentVersion, $version);
- if ($versionCompare == -1) {
+ // note: when versionCompare == 1, the version in the DB is newer, we choose to ignore
+ $currentVersionIsOutdated = version_compare($currentVersion, $version) == -1;
+ $isComponentOutdated = $currentVersion === false || $currentVersionIsOutdated;
+ if ($isComponentOutdated) {
$componentsToUpdate[$name] = array(
self::INDEX_CURRENT_VERSION => $currentVersion,
self::INDEX_NEW_VERSION => $version
);
- } else if ($versionCompare == 1) {
- // the version in the DB is newest.. we choose to ignore
}
}
return $componentsToUpdate;