summaryrefslogtreecommitdiffstats
path: root/lib/private/AppFramework/Utility
diff options
context:
space:
mode:
authorLukas Reschke <lukas@statuscode.ch>2016-09-26 14:10:50 +0200
committerGitHub <noreply@github.com>2016-09-26 14:10:50 +0200
commit598b243838cf7bd738273b190753a7f6b0940773 (patch)
tree5b8576020e2b340dccf10e101c6993457e6a5133 /lib/private/AppFramework/Utility
parentfc6509369432dba2df588348cfafb59208e1d4a4 (diff)
parente200eda18d87b835ca824efd14b2b1eb85e22486 (diff)
downloadnextcloud-server-598b243838cf7bd738273b190753a7f6b0940773.tar.gz
nextcloud-server-598b243838cf7bd738273b190753a7f6b0940773.zip
Merge pull request #1426 from nextcloud/sanitze_opt
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 60496ca329e..8d5bceb0b87 100644
--- a/lib/private/AppFramework/Utility/SimpleContainer.php
+++ b/lib/private/AppFramework/Utility/SimpleContainer.php
@@ -166,7 +166,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;
}
}