aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-02-15 11:20:22 +0100
committerJulius Härtl <jus@bitgrid.net>2018-03-02 17:16:36 +0100
commita61608e8c7cbcdd2f1ea9d15702f532c24b81319 (patch)
tree89dabacef7c4e3704d58b0eb43b9f1b01ebdbe00
parent364e7fe1be64ea02dd817d4a458db8d50140b31a (diff)
downloadnextcloud-server-a61608e8c7cbcdd2f1ea9d15702f532c24b81319.tar.gz
nextcloud-server-a61608e8c7cbcdd2f1ea9d15702f532c24b81319.zip
Properly encapsulate require_once for app.php
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--lib/private/legacy/app.php23
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/private/legacy/app.php b/lib/private/legacy/app.php
index 53841a13acf..24712e0fda6 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
@@ -231,16 +240,8 @@ class OC_App {
* @param string $app app name
*/
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';
}
/**