Fix `DevtoolsProject::getLanguageFiles()` if no language directory exists
authorMatthias Schmidt <gravatronics@live.com>
Sat, 5 Jan 2019 08:51:29 +0000 (09:51 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 5 Jan 2019 08:51:29 +0000 (09:51 +0100)
See #2545

wcfsetup/install/files/lib/data/devtools/project/DevtoolsProject.class.php

index efc84e101d2603d3319434f1be54a680fe5070ae..92fce062ac6483fe589c2d4aa2d574fd0fb144f2 100644 (file)
@@ -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')));
        }