Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2021-05-05 12:50:40 +0300
committerGitHub <noreply@github.com>2021-05-05 12:50:40 +0300
commit4d82a9446d5de3935577aa4ec437d4087392df72 (patch)
tree70860b23e4ca625bb49c0d9ac2346e5bdea69884
parent20b34875d9cc15a0aaadbde212e53866581f0881 (diff)
parent784b059a0132e0e8685a9993bd74d570a5b75ec6 (diff)
Merge pull request #26878 from nextcloud/bugfix/noid/dont-break-occ-when-an-app-is-breaking-in-application-class
Don't break OCC if an app is breaking in it's Application class
-rw-r--r--lib/private/AppFramework/Bootstrap/Coordinator.php29
-rw-r--r--lib/private/legacy/OC_App.php9
2 files changed, 24 insertions, 14 deletions
diff --git a/lib/private/AppFramework/Bootstrap/Coordinator.php b/lib/private/AppFramework/Bootstrap/Coordinator.php
index 33b02c0291f..ad55ea3912e 100644
--- a/lib/private/AppFramework/Bootstrap/Coordinator.php
+++ b/lib/private/AppFramework/Bootstrap/Coordinator.php
@@ -113,21 +113,24 @@ class Coordinator {
*/
$appNameSpace = App::buildAppNamespace($appId);
$applicationClassName = $appNameSpace . '\\AppInfo\\Application';
- if (class_exists($applicationClassName) && in_array(IBootstrap::class, class_implements($applicationClassName), true)) {
- try {
- /** @var IBootstrap|App $application */
- $apps[$appId] = $application = $this->serverContainer->query($applicationClassName);
- } catch (QueryException $e) {
- // Weird, but ok
- continue;
- }
- try {
+ try {
+ if (class_exists($applicationClassName) && in_array(IBootstrap::class, class_implements($applicationClassName), true)) {
+ try {
+ /** @var IBootstrap|App $application */
+ $apps[$appId] = $application = $this->serverContainer->query($applicationClassName);
+ } catch (QueryException $e) {
+ // Weird, but ok
+ continue;
+ }
+
$application->register($this->registrationContext->for($appId));
- } catch (Throwable $e) {
- $this->logger->emergency('Error during app service registration: ' . $e->getMessage(), [
- 'exception' => $e,
- ]);
}
+ } catch (Throwable $e) {
+ $this->logger->emergency('Error during app service registration: ' . $e->getMessage(), [
+ 'exception' => $e,
+ 'app' => $appId,
+ ]);
+ continue;
}
}
diff --git a/lib/private/legacy/OC_App.php b/lib/private/legacy/OC_App.php
index 65365c85e36..ed85253b649 100644
--- a/lib/private/legacy/OC_App.php
+++ b/lib/private/legacy/OC_App.php
@@ -135,7 +135,14 @@ class OC_App {
ob_start();
foreach ($apps as $app) {
if (!isset(self::$loadedApps[$app]) && ($types === [] || self::isType($app, $types))) {
- self::loadApp($app);
+ try {
+ self::loadApp($app);
+ } catch (\Throwable $e) {
+ \OC::$server->get(LoggerInterface::class)->emergency('Error during app loading: ' . $e->getMessage(), [
+ 'exception' => $e,
+ 'app' => $app,
+ ]);
+ }
}
}
ob_end_clean();