-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Conversation
|
||
// Add each app as allowed class path | ||
foreach($apps as $app) { | ||
\OC::$loader->addValidRoot(self::getAppPath($app)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Issue probably when the getter is called more than one time right?
I would not expect this from a getter :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this to loadApps
which should only be called once. That said, even if it is called twice the worst thing which can happen is to have the root allowed twice :)
2a7f7d7
to
bac8c3e
Compare
Perfect :) 👍 |
The autoloader needs to be run before including the app.php, otherwise it depends on what app gets executed first and apps that rely on the dependency of other apps in app.php may break.
bac8c3e
to
8e1b403
Compare
That solves my issue 👍 |
Define allowed app roots earlier
This just (probably) broke upgrading apps, since the addValidRoot has been moved out of |
can we please get a clear state on this? THX |
Phew, it seems we have just avoided disaster. |
@Xenopathic sounds like a plan. Would have to make sure to not add duplicates, but IIRC its a hashmap anyways, so it should not be a problem right? |
@BernhardPosselt Not a hash map, just a regular array. Adding duplicate entries will decrease performance by a small bit, so perhaps just changing it to a hashmap would be the easiest way to prevent duplicates. |
The autoloader needs to be run before including the app.php, otherwise it depends on what app gets executed first and apps that rely on the dependency of other apps in app.php may break.