From b65a7be5b9ff03b96bb44e1e18e74af12daffcd6 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sat, 5 Jan 2019 09:51:29 +0100 Subject: [PATCH] Fix `DevtoolsProject::getLanguageFiles()` if no language directory exists See #2545 --- .../files/lib/data/devtools/project/DevtoolsProject.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/wcfsetup/install/files/lib/data/devtools/project/DevtoolsProject.class.php b/wcfsetup/install/files/lib/data/devtools/project/DevtoolsProject.class.php index efc84e101d..92fce062ac 100644 --- a/wcfsetup/install/files/lib/data/devtools/project/DevtoolsProject.class.php +++ b/wcfsetup/install/files/lib/data/devtools/project/DevtoolsProject.class.php @@ -208,6 +208,10 @@ class DevtoolsProject extends DatabaseObject { public function getLanguageFiles() { $languageDirectory = $this->path . ($this->isCore() ? 'wcfsetup/install/lang/' : 'language/'); + if (!is_dir($languageDirectory)) { + return []; + } + return array_values(DirectoryUtil::getInstance($languageDirectory)->getFiles(SORT_ASC, Regex::compile('\w+\.xml'))); } -- 2.20.1