diff options
author | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-16 09:52:52 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-09-16 09:52:52 +0200 |
commit | e200eda18d87b835ca824efd14b2b1eb85e22486 (patch) | |
tree | 324ead7fc7749d22b061c90b363c19b744cd6fd0 /lib/private/AppFramework/Utility | |
parent | 9fa288f12b7bf29ba2812f93f65dfcac62d1ea75 (diff) | |
download | nextcloud-server-e200eda18d87b835ca824efd14b2b1eb85e22486.tar.gz nextcloud-server-e200eda18d87b835ca824efd14b2b1eb85e22486.zip |
Optimize sanitizeName
Diffstat (limited to 'lib/private/AppFramework/Utility')
-rw-r--r-- | lib/private/AppFramework/Utility/SimpleContainer.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php index 5f637518f4d..ff58e86c804 100644 --- a/lib/private/AppFramework/Utility/SimpleContainer.php +++ b/lib/private/AppFramework/Utility/SimpleContainer.php @@ -157,7 +157,10 @@ class SimpleContainer extends Container implements IContainer { * @return string */ protected function sanitizeName($name) { - return ltrim($name, '\\'); + if (isset($name[0]) && $name[0] === '\\') { + return ltrim($name, '\\'); + } + return $name; } } |