]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use findAppInDirectories
authorLukas Reschke <lukas@statuscode.ch>
Mon, 31 Oct 2016 16:30:02 +0000 (17:30 +0100)
committerLukas Reschke <lukas@statuscode.ch>
Mon, 31 Oct 2016 16:30:02 +0000 (17:30 +0100)
The other function doesn't work if the appstore is disabled

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
lib/private/Installer.php
lib/private/legacy/app.php

index 6aaa6fe6ac33bb7e5da06f5d0d81240d04af97a7..67c949bc1352bba9a72868ea68e1c962970bcd25 100644 (file)
@@ -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
index 6b5c4f3978c5b0e3e5c8179a7d27b0f654be2c59..a89a4650c5d335573ddb7eaeaf93752d92f6fec9 100644 (file)
@@ -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;