]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix the version check for downloaded apps. Fixes https://github.com/owncloud/apps...
authorFrank Karlitschek <frank@owncloud.org>
Mon, 18 Nov 2013 11:16:03 +0000 (12:16 +0100)
committerFrank Karlitschek <frank@owncloud.org>
Mon, 18 Nov 2013 11:16:03 +0000 (12:16 +0100)
lib/private/installer.php

index d7b207c6aadef56eed4c47a6d5c2d127c88f1f0a..91a1df7e3c490c87f33fe16773c6d6bf324140b1 100644 (file)
@@ -147,11 +147,18 @@ class OC_Installer{
                }
 
                // check if the ocs version is the same as the version in info.xml/version
-               if(!isset($info['version']) or ($info['version']<>$data['appdata']['version'])) {
+               $versionFile= $extractDir.'/appinfo/version';
+               if(is_file($versionFile)) {
+                       $version = trim(file_get_contents($versionFile));
+               }else{
+                       $version = trim($info['version']);
+               }
+               
+               if($version<>trim($data['appdata']['version'])) {
                        OC_Helper::rmdirr($extractDir);
                        throw new \Exception($l->t("App can't be installed because the version in info.xml/version is not the same as the version reported from the app store"));
                }
-
+               
                $basedir=OC_App::getInstallPath().'/'.$info['id'];
                //check if the destination directory already exists
                if(is_dir($basedir)) {