From e200eda18d87b835ca824efd14b2b1eb85e22486 Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Fri, 16 Sep 2016 09:52:52 +0200 Subject: [PATCH] Optimize sanitizeName --- lib/private/AppFramework/Utility/SimpleContainer.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/private/AppFramework/Utility/SimpleContainer.php b/lib/private/AppFramework/Utility/SimpleContainer.php index 5f637518f4..ff58e86c80 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; } }