From: Matthias Schmidt Date: Sat, 5 Jan 2019 08:51:29 +0000 (+0100) Subject: Fix `DevtoolsProject::getLanguageFiles()` if no language directory exists X-Git-Tag: 5.2.0_Alpha_1~379 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b65a7be5b9ff03b96bb44e1e18e74af12daffcd6;p=GitHub%2FWoltLab%2FWCF.git Fix `DevtoolsProject::getLanguageFiles()` if no language directory exists See #2545 --- 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'))); }