summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2018-03-05 12:35:50 +0100
committerGitHub <noreply@github.com>2018-03-05 12:35:50 +0100
commit479b9465c0159973315bd56104742a8b0da85460 (patch)
tree29523b5da0378608ed1eebf4f53284995084265d /lib
parentd74bad2dc15b708e91179d6d2229b9edc7948c46 (diff)
parent9f7e05e737398a7f1f58ea8562ebb2981eee64af (diff)
downloadnextcloud-server-479b9465c0159973315bd56104742a8b0da85460.tar.gz
nextcloud-server-479b9465c0159973315bd56104742a8b0da85460.zip
Merge pull request #8631 from nextcloud/stable13-8372
[13] Properly encapsulate require_once for app.php
Diffstat (limited to 'lib')
-rw-r--r--lib/private/legacy/app.php24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 53841a13acf..02d5f6fea4c 100644
--- a/lib/private/legacy/app.php
+++ b/lib/private/legacy/app.php
@@ -136,6 +136,7 @@ class OC_App {
* load a single app
*
* @param string $app
+ * @throws Exception
*/
public static function loadApp($app) {
self::$loadedApps[] = $app;
@@ -149,7 +150,15 @@ class OC_App {
if (is_file($appPath . '/appinfo/app.php')) {
\OC::$server->getEventLogger()->start('load_app_' . $app, 'Load app: ' . $app);
- self::requireAppFile($app);
+ try {
+ self::requireAppFile($app);
+ } catch (Error $ex) {
+ \OC::$server->getLogger()->logException($ex);
+ if (!\OC::$server->getAppManager()->isShipped($app)) {
+ // Only disable apps which are not shipped
+ self::disable($app);
+ }
+ }
if (self::isType($app, array('authentication'))) {
// since authentication apps affect the "is app enabled for group" check,
// the enabled apps cache needs to be cleared to make sure that the
@@ -229,18 +238,11 @@ class OC_App {
* Load app.php from the given app
*
* @param string $app app name
+ * @throws Error
*/
private static function requireAppFile($app) {
- try {
- // encapsulated here to avoid variable scope conflicts
- require_once $app . '/appinfo/app.php';
- } catch (Error $ex) {
- \OC::$server->getLogger()->logException($ex);
- if (!\OC::$server->getAppManager()->isShipped($app)) {
- // Only disable apps which are not shipped
- self::disable($app);
- }
- }
+ // encapsulated here to avoid variable scope conflicts
+ require_once $app . '/appinfo/app.php';
}
/**