summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Utility
diff options
context:
space:
mode:
authorRoeland Jago Douma <roeland@famdouma.nl>2016-09-16 09:52:52 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2016-09-16 09:52:52 +0200
commite200eda18d87b835ca824efd14b2b1eb85e22486 (patch)
tree324ead7fc7749d22b061c90b363c19b744cd6fd0 /lib/private/AppFramework/Utility
parent9fa288f12b7bf29ba2812f93f65dfcac62d1ea75 (diff)
downloadnextcloud-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.php5
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;
}
}