From 7250dc4e98ecccb1688f3d16f04b55de7122c3a7 Mon Sep 17 00:00:00 2001 From: Michael Gapczynski Date: Sun, 1 Jan 2012 16:58:51 -0500 Subject: [PATCH] Fix updateApp() and add extra check to updateApps() --- lib/app.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/app.php b/lib/app.php index 2e03db6c8d..cc1b8041c9 100644 --- a/lib/app.php +++ b/lib/app.php @@ -372,9 +372,11 @@ class OC_App{ foreach( $apps as $app ){ $installedVersion=OC_Appconfig::getValue($app,'installed_version'); $appInfo=OC_App::getAppInfo($app); - $currentVersion=$appInfo['version']; - if (version_compare($currentVersion, $installedVersion, '>')) { - OC_App::updateApp($app); + if (isset($appInfo['version'])) { + $currentVersion=$appInfo['version']; + if (version_compare($currentVersion, $installedVersion, '>')) { + OC_App::updateApp($app); + } } } } @@ -384,11 +386,11 @@ class OC_App{ * @param string appid */ public static function updateApp($appid){ - if(file_exists(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/database.xml')){ - OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/database.xml'); + if(file_exists(OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/database.xml')){ + OC_DB::updateDbFromStructure(OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/database.xml'); } - if(file_exists(OC::$SERVERROOT.'/apps/'.$file.'/appinfo/update.php')){ - include OC::$SERVERROOT.'/apps/'.$file.'/appinfo/update.php'; + if(file_exists(OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/update.php')){ + include OC::$SERVERROOT.'/apps/'.$appid.'/appinfo/update.php'; } } }