From f0ab94d479307e95d9e9114915376bdf57897a0a Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Mon, 4 Dec 2023 08:29:37 +0100 Subject: [PATCH] fix(TemplateManager): Bail early if templatedirectory is empty fixes #39266 Signed-off-by: Marcel Klehr --- lib/private/Files/Template/TemplateManager.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/private/Files/Template/TemplateManager.php b/lib/private/Files/Template/TemplateManager.php index 28e9e4f69e878..9d9f641620885 100644 --- a/lib/private/Files/Template/TemplateManager.php +++ b/lib/private/Files/Template/TemplateManager.php @@ -275,6 +275,11 @@ public function initializeTemplateDirectory(string $path = null, string $userId $isDefaultTemplates = $skeletonTemplatePath === $defaultTemplateDirectory; $userLang = $this->l10nFactory->getUserLanguage($this->userManager->get($this->userId)); + if ($skeletonTemplatePath === '') { + $this->setTemplatePath(''); + return ''; + } + try { $l10n = $this->l10nFactory->get('lib', $userLang); $userFolder = $this->rootFolder->getUserFolder($this->userId);