diff options
-rw-r--r-- | lib/private/Installer.php | 7 | ||||
-rw-r--r-- | lib/private/legacy/app.php | 2 |
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; |