diff options
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/appframework/utility/simplecontainer.php | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/private/appframework/utility/simplecontainer.php b/lib/private/appframework/utility/simplecontainer.php index efe1b0812a6..83a08acde26 100644 --- a/lib/private/appframework/utility/simplecontainer.php +++ b/lib/private/appframework/utility/simplecontainer.php @@ -99,6 +99,7 @@ class SimpleContainer extends Container implements IContainer { * @throws QueryException if the query could not be resolved */ public function query($name) { + $name = $this->sanitizeName($name); if ($this->offsetExists($name)) { return $this->offsetGet($name); } else { @@ -128,6 +129,7 @@ class SimpleContainer extends Container implements IContainer { * @param bool $shared */ public function registerService($name, Closure $closure, $shared = true) { + $name = $this->sanitizeName($name); if (isset($this[$name])) { unset($this[$name]); } @@ -151,4 +153,12 @@ class SimpleContainer extends Container implements IContainer { }, false); } + /* + * @param string $name + * @return string + */ + protected function sanitizeName($name) { + return ltrim($name, '\\'); + } + } |