Fix language file validation when editing core
authorMatthias Schmidt <gravatronics@live.com>
Sat, 7 Dec 2019 10:47:40 +0000 (11:47 +0100)
committerMatthias Schmidt <gravatronics@live.com>
Sat, 7 Dec 2019 10:47:40 +0000 (11:47 +0100)
Close #3118

wcfsetup/install/files/lib/acp/form/DevtoolsProjectAddForm.class.php

index 179acca63cbead5f11c70e0d351cb78bfba6667d..c7632732b28ecde3801907cc8f3c097c993342a8 100644 (file)
@@ -761,6 +761,10 @@ class DevtoolsProjectAddForm extends AbstractFormBuilderForm {
                                                case 'language':
                                                        if ($value === 'language/*.xml') {
                                                                $directory = FileUtil::addTrailingSlash(dirname($path . $value));
+                                                               if ($this->formObject !== null && $this->formObject->isCore()) {
+                                                                       $directory = FileUtil::addTrailingSlash(dirname($path . 'wcfsetup/install/lang/*.xml'));
+                                                               }
+                                                               
                                                                $directoryUtil = DirectoryUtil::getInstance($directory);
                                                                if (empty($directoryUtil->getFiles(SORT_ASC, Regex::compile('.+\.xml')))) {
                                                                        $formField->addValidationError(