]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix updateApp() and add extra check to updateApps()
authorMichael Gapczynski <GapczynskiM@gmail.com>
Sun, 1 Jan 2012 21:58:51 +0000 (16:58 -0500)
committerRobin Appelman <icewind1991@gmail.com>
Sun, 8 Jan 2012 01:12:52 +0000 (02:12 +0100)
lib/app.php

index 6b35cdffec9cbb87e0031754964884c2628626b1..13c4cef32b41c5db59db6f890c799b2bb14302d6 100644 (file)
@@ -381,9 +381,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);
+                               }
                        }
                }
        }
@@ -393,11 +395,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';
                }
        }
 }