]> source.dussan.org Git - nextcloud-server.git/commitdiff
version checks for apps now use all three version numbers and fixed bug that would...
authorBernhard Posselt <nukeawhale@gmail.com>
Mon, 25 Feb 2013 10:39:32 +0000 (11:39 +0100)
committerBernhard Posselt <nukeawhale@gmail.com>
Mon, 25 Feb 2013 10:39:55 +0000 (11:39 +0100)
lib/app.php

index e653c30b2d92bd1c94c525ac62557fd7c86666aa..a5618be84f1d8a4878b0400ef6b7de4849bcbe89 100644 (file)
@@ -223,7 +223,8 @@ class OC_App{
                        // check if the app is compatible with this version of ownCloud
                        $info=OC_App::getAppInfo($app);
                        $version=OC_Util::getVersion();
-                       if(!isset($info['require']) or ($version[0]>$info['require'])) {
+                        $fullVersion = (float) ($version[0] . '.' . $version[1] . $version[2]);
+                        if(!isset($info['require']) or ($fullVersion < (float) $info['require'])) {
                                OC_Log::write('core',
                                        'App "'.$info['name'].'" can\'t be installed because it is'
                                        .' not compatible with this version of ownCloud',
@@ -851,7 +852,8 @@ class OC_App{
                foreach($apps as $app) {
                        // check if the app is compatible with this version of ownCloud
                        $info = OC_App::getAppInfo($app);
-                       if(!isset($info['require']) or (($version[0].'.'.$version[1])>$info['require'])) {
+                        $fullVersion = (float) ($version[0] . '.' . $version[1] . $version[2]);
+                        if(!isset($info['require']) or ($fullVersion < (float) $info['require'])) {
                                OC_Log::write('core',
                                        'App "'.$info['name'].'" ('.$app.') can\'t be used because it is'
                                        .' not compatible with this version of ownCloud',