From: Bernhard Posselt Date: Mon, 25 Feb 2013 22:06:26 +0000 (+0100) Subject: return true once one owncloud version number is bigger at any position X-Git-Tag: v5.0.0RC1~44^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f415f3e03e733e6110827d28470aae51bdaea844;p=nextcloud-server.git return true once one owncloud version number is bigger at any position --- diff --git a/lib/app.php b/lib/app.php index 2eb43a582e2..55b4543ec9f 100644 --- a/lib/app.php +++ b/lib/app.php @@ -885,6 +885,8 @@ class OC_App{ if($owncloudVersion < $appVersion){ return false; + } elseif ($owncloudVersion > $appVersion) { + return true; } } diff --git a/tests/lib/app.php b/tests/lib/app.php index 9cab36903a2..c452d752c9f 100644 --- a/tests/lib/app.php +++ b/tests/lib/app.php @@ -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);