summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2017-03-19 22:09:47 +0100
committerRoeland Jago Douma <roeland@famdouma.nl>2017-03-21 08:52:20 +0100
commit246e9ce547fa885f4335a2bca04ad4f3c559c8e7 (patch)
tree5ff3c8e2f2a6cc918865e8576bd629f5b6122562 /lib/private/AppFramework
parentdf1468481779e2193ad679a7edf5f87fc575ca38 (diff)
downloadnextcloud-server-246e9ce547fa885f4335a2bca04ad4f3c559c8e7.tar.gz
nextcloud-server-246e9ce547fa885f4335a2bca04ad4f3c559c8e7.zip
More elegant handling of recursion
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Diffstat (limited to 'lib/private/AppFramework')
-rw-r--r--lib/private/AppFramework/DependencyInjection/DIContainer.php10
1 files changed, 7 insertions, 3 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();
+ }
}
}