Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Define allowed app roots earlier #19039

Merged
merged 2 commits into from
Sep 15, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion lib/private/app.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ public static function loadApps($types = null) {
}
// Load the enabled apps here
$apps = self::getEnabledApps();

// Add each apps' folder as allowed class path
foreach($apps as $app) {
$path = self::getAppPath($app);
if($path !== false) {
\OC::$loader->addValidRoot($path);
}
}

// prevent app.php from printing output
ob_start();
foreach ($apps as $app) {
Expand All @@ -122,7 +131,6 @@ public static function loadApps($types = null) {
*/
public static function loadApp($app, $checkUpgrade = true) {
self::$loadedApps[] = $app;
\OC::$loader->addValidRoot(self::getAppPath($app));
if (is_file(self::getAppPath($app) . '/appinfo/app.php')) {
\OC::$server->getEventLogger()->start('load_app_' . $app, 'Load app: ' . $app);
if ($checkUpgrade and self::shouldUpgrade($app)) {
Expand Down