From 32bf8ec826dadbfd342627884fbdf83081db9b29 Mon Sep 17 00:00:00 2001 From: Lukas Reschke Date: Fri, 9 Dec 2016 17:46:05 +0100 Subject: Don't use cached informations for app version When installing an app from the appstore the `\OC_App::getAppVersion` code is triggered twice: - First when the downloader tries to compare the current version to the new version on the appstore to check if there is a newer version. This protects against downgrade attacks and is implemented in `\OC\Installer::downloadApp`. - Second, when the app is actually installed the current version is written to the database. (`\OC\Installer::installApp`) This fails however when the version is actually cached. Because in step 1 the cached version will be set to "0" and then be reused in the second step. While this is probably not the cleanest version I assume this is an approach that is least invasive. Feedback and suggestions welcome :) Signed-off-by: Lukas Reschke --- lib/private/Installer.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/private/Installer.php') diff --git a/lib/private/Installer.php b/lib/private/Installer.php index db71f7b1432..38d0ce13684 100644 --- a/lib/private/Installer.php +++ b/lib/private/Installer.php @@ -121,7 +121,7 @@ class Installer { OC_App::executeRepairSteps($appId, $appData['repair-steps']['install']); //set the installed version - \OC::$server->getConfig()->setAppValue($info['id'], 'installed_version', OC_App::getAppVersion($info['id'])); + \OC::$server->getConfig()->setAppValue($info['id'], 'installed_version', OC_App::getAppVersion($info['id'], false)); \OC::$server->getConfig()->setAppValue($info['id'], 'enabled', 'no'); //set remote/public handlers -- cgit v1.2.3