Enfore unified directory separators for project path
authorMatthias Schmidt <gravatronics@live.com>
Tue, 7 May 2019 16:21:15 +0000 (18:21 +0200)
committerMatthias Schmidt <gravatronics@live.com>
Tue, 7 May 2019 16:21:15 +0000 (18:21 +0200)
Close #2925

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

index 0fb83b47b37e3100827284999826dd7f790c5bd9..2b7f38fd43664c041e5bbaeb179cf47af978d2f0 100644 (file)
@@ -136,8 +136,13 @@ class DevtoolsProjectAddForm extends AbstractFormBuilderForm {
                                        ->label('wcf.acp.devtools.project.path')
                                        ->required()
                                        ->addValidator(new FormFieldValidator('validPath', function (TextFormField $formField) {
-                                               // ensure that there is a trailing slash
-                                               $formField->value(FileUtil::addTrailingSlash($formField->getSaveValue() ?? ''));
+                                               // ensure that unified directory separators are used
+                                               // and that there is a trailing slash
+                                               $formField->value(
+                                                       FileUtil::addTrailingSlash(
+                                                               FileUtil::unifyDirSeparator($formField->getSaveValue() ?? '')
+                                                       )
+                                               );
                                                
                                                $path = $formField->getSaveValue();