Encapsulate require_once to avoid name space bleedind
The script required by require_once might use variable names like $app which will conflict with the code that follows. This fix encapsulates require_once into its own function to avoid such issues.
This commit is contained in:
parent
0412f83035
commit
27c22f071d
1 changed files with 11 additions and 1 deletions
|
@ -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
|
||||
|
@ -103,6 +103,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
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue