From 4410f15dd8259ceb0cfda7cbf6b435d3ecfd239a Mon Sep 17 00:00:00 2001
From: Robin Appelman <icewind@owncloud.com>
Date: Sat, 14 Apr 2012 19:01:32 +0200
Subject: [PATCH] don't rely on the old version in info.xml anymore

---
 lib/app.php       | 2 +-
 lib/installer.php | 4 ++--
 lib/migrate.php   | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/app.php b/lib/app.php
index 5fccf1fe68f..1c4a752d8da 100755
--- a/lib/app.php
+++ b/lib/app.php
@@ -482,7 +482,7 @@ class OC_App{
 			if ($currentVersion) {
 				if (version_compare($currentVersion, $installedVersion, '>')) {
 					OC_App::updateApp($app);
-					OC_Appconfig::setValue($app,'installed_version',$appInfo['version']);
+					OC_Appconfig::setValue($app,'installed_version',getAppVersion($app));
 				}
 			}
 		}
diff --git a/lib/installer.php b/lib/installer.php
index 38e17130e3c..044bc9a13d1 100644
--- a/lib/installer.php
+++ b/lib/installer.php
@@ -175,7 +175,7 @@ class OC_Installer{
 		}
 		
 		//set the installed version
-		OC_Appconfig::setValue($info['id'],'installed_version',$info['version']);
+		OC_Appconfig::setValue($info['id'],'installed_version',OC_App::getAppVersion($info['id']));
 		OC_Appconfig::setValue($info['id'],'enabled','no');
 		return $info['id'];
 	}
@@ -297,7 +297,7 @@ class OC_Installer{
 			include(OC::$APPSROOT."/apps/$app/appinfo/install.php");
 		}
 		$info=OC_App::getAppInfo($app);
-		OC_Appconfig::setValue($app,'installed_version',$info['version']);
+		OC_Appconfig::setValue($app,'installed_version',OC_App::getAppVersion('version']));
 		return $info;
 	}
 }
diff --git a/lib/migrate.php b/lib/migrate.php
index dfc34948962..f46d860e806 100644
--- a/lib/migrate.php
+++ b/lib/migrate.php
@@ -434,7 +434,7 @@ class OC_Migrate{
 
 			// Now add some app info the the return array
 			$appinfo = OC_App::getAppInfo( $provider->getID() );
-			$return['apps'][$provider->getID()]['version'] = $appinfo['version'];
+			$return['apps'][$provider->getID()]['version'] = OC_App::getAppVersion($provider->getID());
 
 		}
 
-- 
GitLab