]> source.dussan.org Git - nextcloud-server.git/commitdiff
Skip querying the app container for server namespace
authorJulius Härtl <jus@bitgrid.net>
Wed, 16 Nov 2022 19:21:33 +0000 (20:21 +0100)
committerJulius Härtl <jus@bitgrid.net>
Wed, 7 Dec 2022 21:32:05 +0000 (22:32 +0100)
Signed-off-by: Julius Härtl <jus@bitgrid.net>
lib/private/AppFramework/DependencyInjection/DIContainer.php

index 5fd363ee963cc8252a8b0eb021e6b1f13af8da50..8fe17d5a85e1b69a4722300440675a98910480c8 100644 (file)
@@ -442,6 +442,12 @@ class DIContainer extends SimpleContainer implements IAppContainer {
                if ($name === 'AppName' || $name === 'appName') {
                        return $this->appName;
                }
+
+               $isServerClass = str_starts_with($name, 'OCP\\') || str_starts_with($name, 'OC\\');
+               if ($isServerClass && !$this->has($name)) {
+                       return $this->getServer()->query($name, $autoload);
+               }
+
                try {
                        return $this->queryNoFallback($name);
                } catch (QueryException $firstException) {