diff options
author | Morris Jobke <hey@morrisjobke.de> | 2017-03-20 03:21:02 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-20 03:21:02 -0600 |
commit | c969d8005e45ed3996577005a3778e6c88c0f6b8 (patch) | |
tree | f5710528b4d983f1600b4862c668d3b04a5aa196 /lib | |
parent | ea6b3a95ca29b6ea25c2e79079ea914b424d3f9f (diff) | |
parent | 20c80cba6f4d5f0d56de0842eb9f93534845df4d (diff) | |
download | nextcloud-server-c969d8005e45ed3996577005a3778e6c88c0f6b8.tar.gz nextcloud-server-c969d8005e45ed3996577005a3778e6c88c0f6b8.zip |
Merge pull request #3949 from nextcloud/downstream-27307
Check if app exists before enabling
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/App/AppManager.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php index 6b819ef7ac1..6c1f5ba6940 100644 --- a/lib/private/App/AppManager.php +++ b/lib/private/App/AppManager.php @@ -32,6 +32,7 @@ namespace OC\App; use OCP\App\AppPathNotFoundException; +use OC_App; use OCP\App\IAppManager; use OCP\App\ManagerEvent; use OCP\IAppConfig; @@ -210,8 +211,12 @@ class AppManager implements IAppManager { * Enable an app for every user * * @param string $appId + * @throws \Exception */ public function enableApp($appId) { + if(OC_App::getAppPath($appId) === false) { + throw new \Exception("$appId can't be enabled since it is not installed."); + } $this->installedAppsCache[$appId] = 'yes'; $this->appConfig->setValue($appId, 'enabled', 'yes'); $this->dispatcher->dispatch(ManagerEvent::EVENT_APP_ENABLE, new ManagerEvent( |