summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-10-31 17:30:02 +0100
committerLukas Reschke <lukas@statuscode.ch>2016-10-31 17:30:02 +0100
commitd805df7bb3275b33b53c4591499be0cf68f0a38a (patch)
tree8d0d3ed70eda941d39c3c2455cc2f44cd1ad049a
parenta68595742b4a5e13f27bc5cc9d4bbd79044e1790 (diff)
downloadnextcloud-server-d805df7bb3275b33b53c4591499be0cf68f0a38a.tar.gz
nextcloud-server-d805df7bb3275b33b53c4591499be0cf68f0a38a.zip
Use findAppInDirectories
The other function doesn't work if the appstore is disabled Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
-rw-r--r--lib/private/Installer.php7
-rw-r--r--lib/private/legacy/app.php2
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/private/Installer.php b/lib/private/Installer.php
index 6aaa6fe6ac3..67c949bc135 100644
--- a/lib/private/Installer.php
+++ b/lib/private/Installer.php
@@ -91,7 +91,12 @@ class Installer {
* @return integer
*/
public function installApp($appId) {
- $basedir = OC_App::getInstallPath().'/'.$appId;
+ $app = \OC_App::findAppInDirectories($appId);
+ if($app === false) {
+ throw new \Exception('App not found in any app directory');
+ }
+
+ $basedir = $app['path'].'/'.$appId;
$info = OC_App::getAppInfo($basedir.'/appinfo/info.xml', true);
//install the database
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 6b5c4f3978c..a89a4650c5d 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -555,7 +555,7 @@ class OC_App {
* @param string $appId
* @return false|string
*/
- protected static function findAppInDirectories($appId) {
+ public static function findAppInDirectories($appId) {
$sanitizedAppId = self::cleanAppId($appId);
if($sanitizedAppId !== $appId) {
return false;