From 8b165c5ed59659fce5884c2091774b33b6b857d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Wed, 10 Feb 2016 11:04:12 +0100 Subject: [PATCH] No longer evaluate appinfo/version --- lib/private/app.php | 11 +++-------- lib/private/app/appmanager.php | 3 --- lib/private/installer.php | 9 ++------- lib/public/app.php | 2 +- tests/data/testapp.zip | Bin 895 -> 689 bytes tests/data/testapp2.zip | Bin 2449 -> 2240 bytes 6 files changed, 6 insertions(+), 19 deletions(-) diff --git a/lib/private/app.php b/lib/private/app.php index 2abc015a91..3df3a0e5ba 100644 --- a/lib/private/app.php +++ b/lib/private/app.php @@ -564,7 +564,7 @@ class OC_App { } /** - * get the last version of the app, either from appinfo/version or from appinfo/info.xml + * get the last version of the app from appinfo/info.xml * * @param string $appId * @return string @@ -584,14 +584,9 @@ class OC_App { * @return string */ public static function getAppVersionByPath($path) { - $versionFile = $path . '/appinfo/version'; $infoFile = $path . '/appinfo/info.xml'; - if (is_file($versionFile)) { - return trim(file_get_contents($versionFile)); - } else { - $appData = self::getAppInfo($infoFile, true); - return isset($appData['version']) ? $appData['version'] : ''; - } + $appData = self::getAppInfo($infoFile, true); + return isset($appData['version']) ? $appData['version'] : ''; } diff --git a/lib/private/app/appmanager.php b/lib/private/app/appmanager.php index eeb2216d5a..4855f6f018 100644 --- a/lib/private/app/appmanager.php +++ b/lib/private/app/appmanager.php @@ -297,9 +297,6 @@ class AppManager implements IAppManager { /** * Returns the app information from "appinfo/info.xml". * - * If no version was present in "appinfo/info.xml", reads it - * from the external "appinfo/version" file instead. - * * @param string $appId app id * * @return array app iinfo diff --git a/lib/private/installer.php b/lib/private/installer.php index f30db9ca65..1e4bb96892 100644 --- a/lib/private/installer.php +++ b/lib/private/installer.php @@ -390,16 +390,11 @@ class OC_Installer{ } // check if the ocs version is the same as the version in info.xml/version - $versionFile= $extractDir.'/appinfo/version'; - if(is_file($versionFile)) { - $version = trim(file_get_contents($versionFile)); - }else{ - $version = trim($info['version']); - } + $version = trim($info['version']); if(isset($data['appdata']['version']) && $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")); + throw new \Exception($l->t("App can't be installed because the version in info.xml is not the same as the version reported from the app store")); } return $info; diff --git a/lib/public/app.php b/lib/public/app.php index e25f025d12..032116eb43 100644 --- a/lib/public/app.php +++ b/lib/public/app.php @@ -142,7 +142,7 @@ class App { } /** - * Get the last version of the app, either from appinfo/version or from appinfo/info.xml + * Get the last version of the app from appinfo/info.xml * @param string $app * @return string * @since 4.0.0 diff --git a/tests/data/testapp.zip b/tests/data/testapp.zip index e76c0d187248193e90ad487fbd172af065695aa3..c828572827f4ca1016cd5a859196586ee7f90287 100644 GIT binary patch delta 240 zcmey*wvlzhJ~3tn1`dWNU0xpM$Ik5SWME)83&awWKQc+z`}S?*J7mD)lKx3F)P8{` zGxMavqel)MIKc1HDLCzxii+l=&z*`MIpy!)Tt4_E>e)L_&EgO3b=Ez9TexoAXIjO( z;jq)r84`}0g&&=Ds#v?`x5LIJ+0@w<({3rr>;7F_WU^T`pR<4YX~~jep&486I6GbN z4Vm&{W0BIG#=M{m=`OCv8`%FEbA2g)FFpAs<3kmDW)bX;1v(f46dESKW0DgK@MdKL R39ta6G9v>+1rReZ006-iT4n$M delta 422 zcmdnU`k!sWJ~0LkAmpt*;=+IgBqjz5*JtLX#UG%*pz1BGYaO5oQJk4u)-=ULMT;5kYMX3=C(1Sb|}) zH-}WcZ=WsSAp@S)^s25^>NzHK!v-rPH_+C>-_<%A9ZGF%$Z$tk$d*Pz}Q)q z0X!|sKYwL9H;eDjExDBn7Tir-w&8j$>;+;|XK8e)vs-8{dR@0qesTf3%;bM;e2ff} zdD)#9%_j%2doh*)Ns-A5m^mhIXE$Tq3*~W5UeCxm`39T7gI8k`A49nh$)?yo_9x*aYFbGVZ$RSxD8o|TxT(Lj+6cB%96k+h~+sJpwfX5~M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