diff options
-rw-r--r-- | lib/private/AppFramework/DependencyInjection/DIContainer.php | 10 | ||||
-rw-r--r-- | lib/private/ServerContainer.php | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/lib/private/AppFramework/DependencyInjection/DIContainer.php b/lib/private/AppFramework/DependencyInjection/DIContainer.php index a6251557f6c..354b93873e9 100644 --- a/lib/private/AppFramework/DependencyInjection/DIContainer.php +++ b/lib/private/AppFramework/DependencyInjection/DIContainer.php @@ -559,13 +559,17 @@ class DIContainer extends SimpleContainer implements IAppContainer { }); } - public function query($name, $checkServerContainer = true) { + public function query($name) { $name = $this->sanitizeName($name); + try { return parent::query($name); } catch (QueryException $e) { - if ($checkServerContainer === false) { - throw $e; + if (strpos($name, 'OCA\\') === 0 && substr_count($name, '\\') >= 2) { + $segments = explode('\\', $name); + if (strtolower($segments[1]) === strtolower($this['AppName'])) { + throw new QueryException(); + } } } diff --git a/lib/private/ServerContainer.php b/lib/private/ServerContainer.php index 85229e364ad..df0293addf7 100644 --- a/lib/private/ServerContainer.php +++ b/lib/private/ServerContainer.php @@ -79,7 +79,7 @@ class ServerContainer extends SimpleContainer { $segments = explode('\\', $name); $appContainer = $this->getAppContainer(strtolower($segments[1])); try { - return $appContainer->query($name, false); + return $appContainer->query($name); } catch (QueryException $e) { // Didn't find the service in the respective app container, // ignore it and fall back to the core container. |