]> source.dussan.org Git - nextcloud-server.git/commitdiff
return true once one owncloud version number is bigger at any position
authorBernhard Posselt <nukeawhale@gmail.com>
Mon, 25 Feb 2013 22:06:26 +0000 (23:06 +0100)
committerBernhard Posselt <nukeawhale@gmail.com>
Mon, 25 Feb 2013 22:06:26 +0000 (23:06 +0100)
lib/app.php
tests/lib/app.php

index 2eb43a582e27b07c22a22aa523cab7bf164447d5..55b4543ec9f874b0085a9118eb7334748c1f06c0 100644 (file)
@@ -885,6 +885,8 @@ class OC_App{
 
                        if($owncloudVersion < $appVersion){
                                return false;
+                       } elseif ($owncloudVersion > $appVersion) {
+                               return true;
                        }
                }
 
index 9cab36903a24a7b0d9d6ec87ff704ad411abcffc..c452d752c9f43cc13cc8749fd7242d9619ebe96b 100644 (file)
@@ -40,6 +40,14 @@ class Test_App extends PHPUnit_Framework_TestCase {
                $this->assertTrue(OC_App::isAppVersionCompatible($oc, $app));
        }
 
+
+       public function testIsAppVersionCompatibleComplex(){
+               $oc = array(5, 0, 0);
+               $app = '4.5.1';
+
+               $this->assertTrue(OC_App::isAppVersionCompatible($oc, $app));
+       }
+
        
        public function testIsAppVersionCompatibleShouldFail(){
                $oc = array(4, 3, 1);