aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2014-10-17 14:32:10 +0200
committerLukas Reschke <lukas@owncloud.com>2014-10-17 14:32:10 +0200
commit439b33ec380df147f6d3435bfd54f908ad13dfe2 (patch)
tree7c308d89c90d66ba41ec84070385894faaeb6c0b /lib/private
parent2e875bc6b6a88903212f06fccc050edfc4d108a3 (diff)
parent27c22f071d3f9a3dd6aa99e4e7cddb8e725a1ddf (diff)
downloadnextcloud-server-439b33ec380df147f6d3435bfd54f908ad13dfe2.tar.gz
nextcloud-server-439b33ec380df147f6d3435bfd54f908ad13dfe2.zip
Merge pull request #11634 from owncloud/loadapps-encapsulaterequire
Encapsulate require_once to avoid name space bleedind
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/app.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/private/app.php b/lib/private/app.php
index faaadef3857..a97db7b5e53 100644
--- a/lib/private/app.php
+++ b/lib/private/app.php
@@ -92,7 +92,7 @@ class OC_App {
if ($checkUpgrade and self::shouldUpgrade($app)) {
throw new \OC\NeedsUpdateException();
}
- require_once $app . '/appinfo/app.php';
+ self::requireAppFile($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
@@ -104,6 +104,16 @@ class OC_App {
}
/**
+ * Load app.php from the given app
+ *
+ * @param string $app app name
+ */
+ private static function requireAppFile($app) {
+ // encapsulated here to avoid variable scope conflicts
+ require_once $app . '/appinfo/app.php';
+ }
+
+ /**
* check if an app is of a specific type
*
* @param string $app