Merge pull request #1426 from nextcloud/sanitze_opt

Optimize sanitizeName
This commit is contained in:
Lukas Reschke 2016-09-26 14:10:50 +02:00 committed by GitHub
commit 598b243838
1 changed files with 4 additions and 1 deletions

View File

@ -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;
}
}