summaryrefslogtreecommitdiffstats
path: root/lib/private/Installer.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Installer.php')
-rw-r--r--lib/private/Installer.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index aff2d2194aa..db71f7b1432 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -278,6 +278,20 @@ class Installer {
);
}
+ // Check if the version is lower than before
+ $currentVersion = OC_App::getAppVersion($appId);
+ $newVersion = (string)$xml->version;
+ if(version_compare($currentVersion, $newVersion) === 1) {
+ throw new \Exception(
+ sprintf(
+ 'App for id %s has version %s and tried to update to lower version %s',
+ $appId,
+ $currentVersion,
+ $newVersion
+ )
+ );
+ }
+
$baseDir = OC_App::getInstallPath() . '/' . $appId;
// Remove old app with the ID if existent
OC_Helper::rmdirr($baseDir);