diff --git a/src/Task/TYPO3/CMS/SymlinkDataTask.php b/src/Task/TYPO3/CMS/SymlinkDataTask.php index 7dbf1e97..4be88687 100755 --- a/src/Task/TYPO3/CMS/SymlinkDataTask.php +++ b/src/Task/TYPO3/CMS/SymlinkDataTask.php @@ -44,20 +44,28 @@ public function execute(Node $node, Application $application, Deployment $deploy if ($webDirectory !== '') { $relativeDataPathFromWeb = str_repeat('../', substr_count(trim($webDirectory, '/'), '/') + 1) . $relativeDataPath; } - $absoluteWebDirectory = rtrim("$targetReleasePath/$webDirectory", '/'); + $absoluteWebDirectory = Files::concatenatePaths([$targetReleasePath, $webDirectory]); $commands[] = 'cd ' . escapeshellarg($targetReleasePath); foreach ($options['symlinkDataFolders'] as $directory) { - $commands[] = sprintf('mkdir -p %1$s', escapeshellarg($relativeDataPath . '/' . $directory)); - $commands[] = sprintf('ln -sf %1$s %2$s', escapeshellarg($relativeDataPathFromWeb . '/' . $directory), escapeshellarg($absoluteWebDirectory . '/' . $directory)); + $commands[] = sprintf('mkdir -p %1$s', escapeshellarg(Files::concatenatePaths([$relativeDataPath, $directory]))); + $commands[] = sprintf( + 'ln -sf %1$s %2$s', + escapeshellarg(Files::concatenatePaths([$relativeDataPathFromWeb, $directory])), + escapeshellarg(Files::concatenatePaths([$absoluteWebDirectory, $directory])) + ); } foreach ($options['directories'] as $directory) { $directory = trim($directory, '\\/'); $targetDirectory = Files::concatenatePaths([$relativeDataPath, $directory]); $commands[] = sprintf('mkdir -p %1$s', escapeshellarg($targetDirectory)); - $commands[] = sprintf('ln -sf %1$s %2$s', escapeshellarg(str_repeat('../', substr_count(trim($directory, '/'), '/')) . $targetDirectory), escapeshellarg($directory)); + $commands[] = sprintf( + 'ln -sf %1$s %2$s', + escapeshellarg(str_repeat('../', substr_count(trim($directory, '/'), '/')) . $targetDirectory), + escapeshellarg($directory) + ); } $this->shell->executeOrSimulate($commands, $node, $deployment); }