diff options
author | Frank Karlitschek <frank@owncloud.org> | 2013-11-18 12:16:03 +0100 |
---|---|---|
committer | Frank Karlitschek <frank@owncloud.org> | 2013-11-18 12:16:03 +0100 |
commit | e5994f9c1ac93fec60b6798abf2f98c102370847 (patch) | |
tree | b4ea6ae35f43cd6f9bae5b8083ba98e2b08a9154 /lib/private/installer.php | |
parent | c3746e866af8b68d16c5b42c98ed63b9a4a402ed (diff) | |
download | nextcloud-server-e5994f9c1ac93fec60b6798abf2f98c102370847.tar.gz nextcloud-server-e5994f9c1ac93fec60b6798abf2f98c102370847.zip |
fix the version check for downloaded apps. Fixes https://github.com/owncloud/apps/issues/1485
Diffstat (limited to 'lib/private/installer.php')
-rw-r--r-- | lib/private/installer.php | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/private/installer.php b/lib/private/installer.php index d7b207c6aad..91a1df7e3c4 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -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)) { |